1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Files
archived-php-src/Zend/tests/first_class_callable_005.phpt
T
2021-07-23 10:58:05 +02:00

33 lines
536 B
PHP

--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