#41396 [NEW]: array_reverse -> preserve keys switch not working

From: Date: Tue, 15 May 2007 10:46:00 +0000
Subject: #41396 [NEW]: array_reverse -> preserve keys switch not working
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112648@lists.php.net to get a copy of this message
From: dave at emaildienst dot de Operating system: Debian Etch PHP version: 5.2.2 PHP Bug Type: Arrays related Bug description: array_reverse -> preserve keys switch not working Description: ------------ when doing an array reverse with the "preserve keys" switch, just the values should be reversed. in fact it makes no difference if the preserve keys switch is true or not. Reproduce code: --------------- $array[0] = 3; $array[1] = 1; $array[2] = 2; $firsNewArray=array_reverse($array); $secondNewArray=array_reverse($array, true); Expected result: ---------------- $firstNewArray ( [2] => 2 [1] => 1 [0] => 3 ) $secondNewArray ( [0] => 2 [1] => 1 [2] => 3 ) Actual result: -------------- $firstNewArray ( [2] => 2 [1] => 1 [0] => 3 ) $secondNewArray ( [2] => 2 [1] => 1 [0] => 3 ) -- Edit bug report at http://bugs.php.net/?id=41396&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41396&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41396&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41396&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41396&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41396&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41396&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41396&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41396&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41396&r=support Expected behavior: http://bugs.php.net/fix.php?id=41396&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41396&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41396&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41396&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41396&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41396&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41396&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41396&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41396&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41396&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41396&r=mysqlcfg

« previous php.bugs (#112648) next »