1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
--TEST--
First Class Callable from Magic
--FILE--
<?php
class Foo {
public function __call($method, $args) {
return $method;
}
public static function __callStatic($method, $args) {
return static::class . "::" . $method;
}
}
class Bar extends Foo {}
$foo = new Foo;
$bar = $foo->anythingInstance(...);
echo $bar(), "\n";
$qux = Foo::anythingStatic(...);
echo $qux(), "\n";
$qux2 = Bar::anythingStatic(...);
echo $qux2(), "\n";
?>
--EXPECT--
anythingInstance
Foo::anythingStatic
Bar::anythingStatic
|