- forward_static_call: documentation ( source)
<?php
class A {
public function __call($name, $arguments) {
echo("i don't want to be in here :-(");
}
public static function __callStatic($name, $arguments) {
echo('i want to be in here, but how?');
}
public function instanceMethod() {
// objective: call a non-existing static method,
// so that eventually __callStatic is called and
// can take care of things
forward_static_call(['A', 'test']);
}
}
(new A())->instanceMethod();