closure_054.phpt 307 B

123456789101112131415161718192021
  1. --TEST--
  2. Closure 054: self::class in non-static closure in non-static method.
  3. --FILE--
  4. <?php
  5. class A {
  6. function foo() {
  7. $f = function() {
  8. return self::class;
  9. };
  10. return $f();
  11. }
  12. }
  13. class B extends A {}
  14. $b = new B;
  15. var_dump($b->foo());
  16. ?>
  17. --EXPECT--
  18. string(1) "A"