fork download
  1. <?php
  2. echo "<p>PHP FILE CONNECTED.....</p>"; //This prints
  3. $commands = array(
  4. 0 => "ls",
  5. 1 => "ls -a",
  6.  
  7. );
  8. run();
  9. function run() {
  10. echo "<p> GET RECIEVED... </p>"; //this prints
  11. for($i = 0; $i < count($commands); $i++) {
  12. $res = "dummy value";
  13. echo "<p>$res</p>"; //this never works
  14. echo "<p>lol</p>"; //this prints once
  15. }
  16. }
  17. ?>
Success #stdin #stdout #stderr 0s 52488KB
stdin
Standard input is empty
stdout
<p>PHP FILE CONNECTED.....</p><p> GET RECIEVED... </p>
stderr
PHP Notice:  Undefined variable: commands in /home/ME5JHp/prog.php on line 11