This is very basic question, I have this class which says i can define my own handler which will alter the callName()
function in the example below :
class MyClass
{
protected static $callHandler;
public static function callName($name){
if (static::$callHandler) {
return call_user_func(static::$callHandler, $name);
}
print $name;
}
}
I know i can do this : $class = new MyClass(); $class->callName("Jonny");
But how do I define my own $callhandler in call_user_func
and alter the outcome?