I have a question about a strange comportement.
Look at this code :
class User
{
public function can($name) {
return call_user_func(array($name, 'test'));
}
public static function __callStatic($name, $args) {
return 'User::__callStatic';
}
public function __call($name, $args) {
return 'User::__call';
}
}
class Foo
{
public static function __callStatic($name, $args) {
return 'Foo::__callStatic';
}
public function __call($name, $args) {
return 'Foo::__call?';
}
}
$u = new User();
var_dump($u->can('User'));
var_dump($u->can('Foo'));
The results of the first var dump is : "User::__call" And the second : "Foo::__callStatic"
Why the first one don't call the function __callStatic ?
PS : I look at other topics, but not found an explaination.
Thanks