fork download
  1. <?php
  2.  
  3. $hi = fopen('php://stdin', "r");
  4. $ho = fopen('php://stdout', "w");
  5.  
  6. while (true)
  7. {
  8. fscanf($hi, "%d", $n);
  9. if ($n == 42)
  10. break;
  11. fwrite($ho, sprintf("%d\n", $n));
  12. }
  13.  
  14. fclose($ho);
  15. fclose($hi);
  16. ?>
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
prog.nim(1, 2) Error: undeclared identifier: '<?'
stdout
Standard output is empty