PHP - access attributes and methods of outside object
<p>I'm new to php and I was wondering why this doesn't work:</p>

<pre><code>class A {
      private $containigObject;
      public function __construct($containigObject){
        $this-&gt;containigObject = $containigObject;
      }
      public function functionThatAccessOutsideObject(){
        //...
        $this-&gt;containgObject-&gt;b = 2;
        //...
      }
}

class B {
      public $b = 1;
      public function someFunction(){
        //...
        $a = new A($this);
        $a-&gt;functionThatAccessOutsideObject();
        //...
      }
}

$b = new B();
$b-&gt;someFunction();
</code></pre>

<p>I'm trying to use attributes and methods from Class B in Class A</p>
