<?php
abstract class A {
abstract function foo();
public function callingD() {
D::doSomething([$this, 'foo']);
}
}
class B extends A {
function foo() {
echo 'yayff';
}
}
class D {
public static function doSomething(callable $fun) {
$fun();
}
}
$obj = new B;
$obj->callingD();