2003-02-25 16:21:00 +00:00
|
|
|
--TEST--
|
2003-10-24 03:31:57 +00:00
|
|
|
Bug #22414 (passthru() does not read data correctly)
|
2003-05-15 19:20:31 +00:00
|
|
|
--INI--
|
2003-07-15 07:06:42 +00:00
|
|
|
safe_mode=
|
2003-05-15 19:20:31 +00:00
|
|
|
output_handler=
|
2003-02-25 16:21:00 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2003-05-18 14:55:18 +00:00
|
|
|
|
|
|
|
$php = getenv('TEST_PHP_EXECUTABLE');
|
|
|
|
$tmpfile = tempnam('/tmp', 'phpt');
|
2003-02-25 16:21:00 +00:00
|
|
|
|
|
|
|
/* Regular Data Test */
|
2003-07-15 07:06:42 +00:00
|
|
|
passthru($php . ' -n -r " echo \"HELLO\"; "');
|
2003-02-25 16:21:00 +00:00
|
|
|
|
|
|
|
echo "\n";
|
|
|
|
|
|
|
|
/* Binary Data Test */
|
|
|
|
@unlink($pwd . '/passthru_test');
|
|
|
|
|
2003-07-15 07:06:42 +00:00
|
|
|
$cmd = $php . ' -n -r \"readfile(@getenv(\'TEST_PHP_EXECUTABLE\')); \"';
|
|
|
|
$cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
|
2003-02-25 16:21:00 +00:00
|
|
|
exec($cmd);
|
2003-07-15 07:06:42 +00:00
|
|
|
|
2003-05-17 20:06:00 +00:00
|
|
|
if (md5_file($php) == md5_file($tmpfile)) {
|
2003-02-25 16:21:00 +00:00
|
|
|
echo "Works\n";
|
|
|
|
} else {
|
|
|
|
echo "Does not work\n";
|
|
|
|
}
|
|
|
|
|
2003-05-17 20:06:00 +00:00
|
|
|
@unlink($tmpfile);
|
2003-02-25 16:21:00 +00:00
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
HELLO
|
|
|
|
Works
|