I want to use __callStatic as a preProcessor for calling static methods. My idea is to make the methods private so every static call is forwarded to __callStatic. Then I could use this to do some stuff and call the method then. But it seems not possible. Here is an example:
class A {
public static function __callStatic($name, $params) {
var_dump($name);
// TODO call the private function from class B here
//call_user_func_array('self::' . $name, $params); //infinite loop
}
}
class B extends A {
private static function test($bar) {
echo $bar;
}
}
B::test('foo');
Perhaps somebody is having a solution :-)