010-2.phpt 469 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. executing a code with -R
  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_txt = __DIR__."/010.test.txt";
  14. $txt = '
  15. test
  16. hello
  17. ';
  18. file_put_contents($filename_txt, $txt);
  19. var_dump(`cat "$filename_txt" | "$php" -n -R "var_dump(1);"`);
  20. @unlink($filename_txt);
  21. echo "Done\n";
  22. ?>
  23. --EXPECT--
  24. string(21) "int(1)
  25. int(1)
  26. int(1)
  27. "
  28. Done