first_class_callable_004.phpt 298 B

123456789101112131415161718192021
  1. --TEST--
  2. First Class Callable from Private Scope
  3. --FILE--
  4. <?php
  5. class Foo {
  6. private function method() {
  7. return __METHOD__;
  8. }
  9. public function bar() {
  10. return $this->method(...);
  11. }
  12. }
  13. $foo = new Foo;
  14. $bar = $foo->bar(...);
  15. echo ($bar())();
  16. ?>
  17. --EXPECT--
  18. Foo::method