010.phpt 637 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. executing a file with -F
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. if (substr(PHP_OS, 0, 3) == 'WIN') {
  7. die ("skip not for Windows");
  8. }
  9. ?>
  10. --FILE--
  11. <?php
  12. $php = getenv('TEST_PHP_EXECUTABLE');
  13. $filename = __DIR__."/010.test.php";
  14. $filename_txt = __DIR__."/010.test.txt";
  15. $code = '
  16. <?php
  17. var_dump(fread(STDIN, 10));
  18. ?>
  19. ';
  20. file_put_contents($filename, $code);
  21. $txt = '
  22. test
  23. hello';
  24. file_put_contents($filename_txt, $txt);
  25. var_dump(`cat "$filename_txt" | "$php" -n -F "$filename"`);
  26. ?>
  27. --CLEAN--
  28. <?php
  29. @unlink(__DIR__."/010.test.php");
  30. @unlink(__DIR__."/010.test.txt");
  31. ?>
  32. --EXPECT--
  33. string(25) "
  34. string(10) "test
  35. hello"
  36. "