class m
{
public static function __callStatic($name, $arguments)
{
echo "Calling static method '$name' "
. implode(', ', $arguments). "\n";
}
}
class MethodTest extends m
{
public function __call($name, $arguments)
{
echo "Calling object method '$name' "
. implode(', ', $arguments). "\n";
}
}
class MethodTest2 extends m
{
public function index()
{
MethodTest::test();
}
}
call_user_func(['MethodTest2','index']);
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method MethodTest2::index() should not be called statically in /var/www/html/api/index.php on line 45 Calling static method 'test'
Aucun commentaire:
Enregistrer un commentaire