Lets say I have the following abstract class:
abstract class A{
abstract public function foo(){}
}
And this child class that extends the above abstract class:
class B extends A{
public function foo(){ echo 'bar'; }
}
And somewhere else in my code, I call:
call_user_func( array('B', 'foo') );
As far as I can tell from the call_user_func() documentation, foo() will be called statically:
Class methods may also be invoked statically using this function by passing array($classname, $methodname) to this parameter. Additionally class methods of an object instance may be called by passing array($objectinstance, $methodname) to this parameter.
However, I was under the impression that since PHP 5.3+, abstract static methods were not allowed/should not be used. Is it that abstract static methods cannot be declared, but can still be called statically either using the ::
operator or call_user_func()
? I am confused ...