|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-02-22 05:19 UTC] stas@php.net
[2001-02-22 18:40 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 17:00:01 2025 UTC |
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.