bug49847.phpt 444 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #49847 (exec() fails on lines larger then 4095 bytes)
  3. --FILE--
  4. <?php
  5. $iswin = substr(PHP_OS, 0, 3) == "WIN";
  6. if ($iswin) {
  7. $f = __DIR__ . '\\bug49847.tmp';
  8. $s = str_repeat(' ', 4097);
  9. $s .= '1';
  10. file_put_contents($f, $s);
  11. exec('type ' . $f, $output);
  12. } else {
  13. exec("printf %4098d 1", $output);
  14. }
  15. var_dump($output);
  16. if ($iswin) {
  17. unlink($f);
  18. }
  19. ?>
  20. --EXPECTF--
  21. array(1) {
  22. [0]=>
  23. string(4098) "%s 1"
  24. }