first_class_callable_005.phpt 536 B

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