Is there any way to assign a static function to a variable, or accomplishing this in some other way?
class my_class{
public static function my_method($a){
return $a;
}
}
$some_func = my_class::my_method;
$someAnonFunc = function($a) use ($some_func){
return $some_func($a);
}
$inst = new SomeOtherClass(); //Defined somewhere else, in some other file
$inst->someMethod($a, $someAnonFunc);
At this point, I get:
Fatal error: Undefined class constant 'my_method'