Calling a function from a child class
<p>I have a feeling that what I am trying to do is impossible as I can't find anything on it. I have a few classes that extend from another class. Inside of the class that is being extended, I have to call some unique code based on which class is calling it.</p>

<p>This is something of an in-depth project, so I created a testcase that should explain what I am trying to do:</p>

<pre><code>class parent {
    function traverseTable($table) {
        foreach($table-&gt;getElementsByTagName('tr') {
            $rowCnt++;
            $this-&gt;uniqueSearch($rowCnt);
        }
    }
}

class child1 extends parent {
    function search($input) {
        //parse input, get $table
        $this-&gt;traverseTable($table);
    }

    function uniqueSearch($rowCnt) {
         echo 'child1';
        //Do different things
    }
}

class child2 extends parent {
    function search($input) {
        //parse input, get $table
        $this-&gt;traverseTable($table);
    }

    function uniqueSearch($rowCnt) {
         echo 'child2';
        //Do different things
    }
}
</code></pre>

<p>Basically, I want to be able to call the uniqueSearch() function from inside the loop in Class Parent; but the above syntax does not seem to work. Anybody have any ideas? The real size of the uniqueSearch functions vary from 20-100 lines at this point, but might get bigger.</p>
