From: steemann at globalpark dot de
Operating system: Linux 2.4.21-99
PHP version: 5.1.0RC1
PHP Bug Type: Scripting Engine problem
Bug description: Different code execution order than in previous PHP versions
Description:
------------
I noticed a slight change in the order some instructions
get executed.
The execution order of instructions for a code like
$result[$base]=$base++;
differs from PHP 5.1 to previous versions so that the
$result variable also has different values as follows:
PHP 4.3.10 : array(1) { [0]=> int(0) }
PHP 5.0.3 : array(1) { [0]=> int(0) }
PHP 5.1.0b3 : array(1) { [1]=> int(0) }
PHP 5.1.0RC1 : array(1) { [1]=> int(0) }
Reproduce code:
---------------
$base=0;
$result[$base]=$base++;
var_dump($result);
Expected result:
----------------
To keep compatibility with PHP 4.x and 5.0.x:
array(1) { [0]=> int(0) }
Actual result:
--------------
array(1) { [1]=> int(0) }
--
Edit bug report at http://bugs.php.net/?id=34601&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34601&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34601&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34601&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34601&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34601&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34601&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34601&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34601&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34601&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34601&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34601&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34601&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34601&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34601&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34601&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34601&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34601&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34601&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34601&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34601&r=mysqlcfg