access class variable within a class being instantiated in class that has the variable
<p>take this example:</p>

<pre><code>class Parent
{
    public function __construct()
    {
        $this-&gt;config = array('a' =&gt; 'b');
        $this-&gt;child = new Child();
    }

    public function calling()
    {
        $this-&gt;config['b'] = 'b';
        $this-&gt;child-&gt;answering();
    }
}

class Child
{
    public function answering()
    {
        return $this-&gt;config['b'];
    }
}
</code></pre>

<p>p.s. I know returning <code>$this-&gt;config['b']</code> won't work, but I didn't know how to return what I wanted so I inserted that as a filler.</p>

<p>how can I instantiate the <code>Child</code> class into the <code>Parent</code> class and somehow access the parent variable <code>config</code> inside of the child class.</p>
