fork download
  1. <?php
  2. class A {
  3. public static function foo() {
  4. static::who();
  5. }
  6.  
  7. public static function who() {
  8. echo __CLASS__."\n";
  9. }
  10. }
  11.  
  12. class B extends A {
  13. public static function test() {
  14. A::foo();
  15. parent::foo();
  16. self::foo();
  17. }
  18.  
  19. public static function who() {
  20. echo __CLASS__."\n";
  21. }
  22. }
  23. class C extends B {
  24. public static function who() {
  25. echo __CLASS__."\n";
  26. }
  27. }
  28.  
  29. C::test();
  30. // your code goes here
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
A
C
C