fork(1) download
  1. <?php
  2.  
  3. class test
  4. {
  5. public static function run()
  6. {
  7. echo "Number is: ".$num;
  8. }
  9. }
  10.  
  11. class testchild extends test
  12. {
  13. protected static $num = 5;
  14. public static function exec()
  15. {
  16. $num = 5;
  17. parent::run();
  18. }
  19. }
  20.  
  21. testchild::exec();
  22.  
Success #stdin #stdout #stderr 0.01s 20520KB
stdin
Standard input is empty
stdout
Number is: 
stderr
PHP Notice:  Undefined variable: num in /home/hNfkmT/prog.php on line 7