fork download
  1. <?php
  2.  
  3. class ME {
  4. public static function staticMethod() {
  5. echo __CLASS__;
  6. }
  7.  
  8. public function yarr() {
  9. $this::staticMethod();
  10. }
  11.  
  12. public function hurr() {
  13. self::staticMethod();
  14. }
  15. }
  16.  
  17. class YU extends ME {
  18. public static function staticMethod() {
  19. echo __CLASS__;
  20. }
  21. }
  22.  
  23.  
  24. $x = new YU();
  25.  
  26. $x->yarr();
  27.  
  28. echo "\n";
  29.  
  30. $x->hurr();
Success #stdin #stdout 0.01s 23552KB
stdin
Standard input is empty
stdout
YU
ME