Having trouble when loading class through another extended class in PHP
<p>I have three class: <strong>A</strong>, <strong>B</strong> and <strong>C</strong>.
In class <strong>A</strong>, A.php:</p>

<pre><code>class A
{
    function __Contruct()
    {
          //do something
    }
}
</code></pre>

<p>In class <strong>B</strong>, B.php:</p>

<pre><code>class B extends A
{
    function __Contruct()
    {
         //do something
    }
}
</code></pre>

<p>In class <strong>C</strong>:</p>

<pre><code>class C
{
    function __Contruct()
    {
         include(A.php);
         $this-&gt;A = new A;
         include(B.php);
         $this-&gt;B = new B;
    }
    function _load()
    {
         //load class $X;
    }
}
</code></pre>

<p>I need to load a class whose name is value of a variable:$X to class without word <strong>new</strong> in class B.</p>

<p>Can I do it this way:<code>$this-&gt;classname-&gt;functionname();//classname is value of $X</code> in file B.php.</p>
