#25878 [NEW]: Different behaviour with array indexing by using the '++' incremental operator

From: Date: Wed, 15 Oct 2003 11:52:44 +0000
Subject: #25878 [NEW]: Different behaviour with array indexing by using the '++' incremental operator
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-49051@lists.php.net to get a copy of this message
From: cochius at advantic dot de Operating system: W2k PHP version: 4.3.2 PHP Bug Type: Variables related Bug description: Different behaviour with array indexing by using the '++' incremental operator Description: ------------ There's different behaviour in PHP Version 4.1.2 and Version 4.3.2 when using the '++' incremental operator with the indexing variable. Examine the example and it's different output, it's self-describing... Reproduce code: --------------- $r = array('val_1','val_2'); $j = 0; while (isset($r[$j])) { $temp_arr[$j] = $r[$j++]; } print_r($temp_arr); Expected result: ---------------- PHP Version 4.1.2 ----------------- Array ( [0] => val_1 [1] => val_2 ) Actual result: -------------- PHP Version 4.3.2 ----------------- Array ( [1] => val_1 [2] => val_2 ) -- Edit bug report at http://bugs.php.net/?id=25878&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25878&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25878&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25878&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25878&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25878&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25878&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25878&r=support Expected behavior: http://bugs.php.net/fix.php?id=25878&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25878&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25878&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25878&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25878&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25878&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25878&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25878&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=25878&r=float

« previous php.bugs (#49051) next »