lsb_004.phpt 341 B

123456789101112131415161718192021
  1. --TEST--
  2. ZE2 Late Static Binding testing get_called_class()
  3. --FILE--
  4. <?php
  5. class TestClass {
  6. public static function getClassName() {
  7. return get_called_class();
  8. }
  9. }
  10. class ChildClass extends TestClass {}
  11. echo TestClass::getClassName() . "\n";
  12. echo ChildClass::getClassName() . "\n";
  13. ?>
  14. ==DONE==
  15. --EXPECT--
  16. TestClass
  17. ChildClass
  18. ==DONE==