mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
- make it work on win, simplify expect using expectf
This commit is contained in:
parent
6407250e70
commit
d0ab70458d
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user