PHP 4.0 Bug #8466: Return status of executed command not passed correct in Exec() and System()
| From: | kent dot hansen at bigfoot dot com | Date: | Thu, 28 Dec 2000 22:29:17 +0000 |
| Subject: | PHP 4.0 Bug #8466: Return status of executed command not passed correct in Exec() and System() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42480@lists.php.net to get a copy of this message | ||
From: kent.hansen@bigfoot.com
Operating system: Linux (RedHat 6.2)
PHP version: 4.0.4
PHP Bug Type: Program Execution
Bug description: Return status of executed command not passed correct in Exec() and System()
The functions Exec() and System() fails to pass the return status of the command to the return_var
variable. It always passes "-1".
This script reproduces the bug:
<?php
$rc=0;
unset($array);
exec ("ls /", $array, $rc);
echo "return value: $rc<br>";
echo "output:<br>";
$rows=count($array);
for ($i=0; $i<$rows; $i++) {
echo $array[$i]."<br>";
}
?>
The output is:
return value: -1
output:
bin
boot
dev
...etc...
The "return value" is also "-1" if I change "/" to
"/dont/exists/".
This bug is introduced in version 4.0.4, exec() worked in version 4.0.3pl1.
--
Edit Bug report at: http://bugs.php.net/?id=8466&edit=1