From:             danielc at analysisandsolutions dot com
Operating system: Windows 2000
PHP version:      5CVS-2004-07-03 (dev)
PHP Bug Type:     Unknown/Other Function
Bug description:  exec()'s output array overwritten

Description:
------------
In PHP 4, when using exec() multiple times with the same array in the
"output" parameter, the data from subsequent exec() calls appended the new
results to the existing array.  This is as the manual says.

When PHP 5 first came out, each call to exec() overwrote the prior array.
At some point a while ago, there was discussion on the list and things
were changed back to the old behavior.

At some point after that, the arrays started getting overwritten again. Is
this intentional?

I saw no notices about it in README.PHP4-TO-PHP5-THIN-CHANGES or in the
man page.

Can the old behavior be reimplemented in order to preserve compatibility?

I made a post about this to internals:
http://marc.theaimsgroup.com/?l=php-dev&m=108874256229775&w=2

Reproduce code:
---------------
<?php
exec('date', $Return);
exec('date', $Return);
print_r($Return);
?>


Expected result:
----------------
Array
(
    [0] => The current date is: Fri 07/02/2004
    [1] => Enter the new date: (mm-dd-yy)
    [2] => The current date is: Fri 07/02/2004
    [3] => Enter the new date: (mm-dd-yy)
)

Actual result:
--------------
Array
(
    [0] => The current date is: Fri 07/02/2004
    [1] => Enter the new date: (mm-dd-yy)
)

-- 
Edit bug report at http://bugs.php.net/?id=28999&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28999&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28999&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28999&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28999&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28999&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28999&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28999&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28999&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28999&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28999&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28999&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28999&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28999&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28999&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28999&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28999&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28999&r=float

Reply via email to