Passing a reference to a function in PHP
<p>I saw some similar questions but none were exactly what I need.<br>
I have the following classes:</p>

<pre><code>abstract class A
{
    abstract function foo(); 

    public function callingD()
    {
         D::doSomething($this-&gt;foo());  //something like that
    }
}

class B extends A
{
    function foo()
    {
       //some code
    }
}

class C extends A
{
    function foo()
    {
       //some code
    }
}

class D
{
    public static function doSomething($fooImp)
    {
       //some code
    }
}
</code></pre>

<p>Now, what I want is to call <code>D::doSomething</code> from a function in class <code>A</code> and that one of the parameters for <code>doSomething</code> will be the implementation of <code>foo</code> in <code>A</code>'s current instance. Is it possible?</p>