lsb_017.phpt 358 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. ZE2 Late Static Binding nested calls
  3. --FILE--
  4. <?php
  5. class A {
  6. public static function test($x=null) {
  7. if (!is_null($x)) {
  8. echo "$x\n";
  9. }
  10. return get_called_class();
  11. }
  12. }
  13. class B extends A {
  14. }
  15. class C extends A {
  16. }
  17. class D extends A {
  18. }
  19. echo A::test(B::test(C::test(D::test())))."\n";
  20. ?>
  21. --EXPECT--
  22. D
  23. C
  24. B
  25. A