lsb_017.phpt 343 B

1234567891011121314151617181920212223242526272829
  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. ==DONE==
  22. --EXPECT--
  23. D
  24. C
  25. B
  26. A
  27. ==DONE==