- make it work on win, simplify expect using expectf

This commit is contained in:
Pierre Joye 2010-01-25 13:49:47 +00:00
parent 4dbaaae979
commit 2c3e14e47a

View File

@ -2,11 +2,24 @@
Bug #49847 (exec() fails on lines larger then 4095 bytes)
--FILE--
<?php
exec("printf %4098d 1", $output);
$iswin = substr(PHP_OS, 0, 3) == "WIN";
if ($iswin) {
$f = dirname(__FILE__) . '\\bug49847.tmp';
$s = str_repeat(' ', 4097);
$s .= '1';
file_put_contents($f, $s);
exec('more ' . $f, $output);
} else {
exec("printf %4098d 1", $output);
}
var_dump($output);
if ($iswin) {
unlink($f);
}
?>
--EXPECT--
--EXPECTF--
array(1) {
[0]=>
string(4098) " 1"
string(4098) "%s 1"
}