fork(1) download
  1. <?php
  2.  
  3. class AnotherClass
  4. {
  5. public $name = 'hoh';
  6. public static function ff () {
  7. echo $this->name;
  8. }
  9.  
  10. }
  11. class ClassName extends AnotherClass
  12. {
  13. public static function lol () {
  14. echo $this->name;
  15.  
  16. }
  17. }
  18. $us = new ClassName();
  19. $us::lol();
Runtime error #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Using $this when not in object context in /home/zYuEEr/prog.php:14
Stack trace:
#0 /home/zYuEEr/prog.php(19): ClassName::lol()
#1 {main}
  thrown in /home/zYuEEr/prog.php on line 14