#19241 [Opn->Csd]: array_pop reorders index

From: Date: Thu, 05 Sep 2002 09:00:54 +0000
Subject: #19241 [Opn->Csd]: array_pop reorders index
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18476@lists.php.net to get a copy of this message
ID: 19241 Updated by: derick@php.net Reported By: oliver.neumann@newidentity.de -Status: Open +Status: Closed Bug Type: Arrays related Operating System: Linux PHP Version: 4.1.2 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. This is fixed in CVS, but only for 4.3.0+ Derick Previous Comments: ------------------------------------------------------------------------ [2002-09-05 03:50:08] oliver.neumann@newidentity.de Lets say we have an array : -x-x-x- Array ( [3494374378] => "test1", [5895584478] => "test2", [6472593387] => "test3", [7843747484] => "test4", [8340983427] => "test5", [9240982302] => "test6" ) -x-x-x- after doing array_pop, we now have : -x-x-x- Array ( [0] => "test1", [1] => "test2", [2] => "test3", [3] => "test4", [4] => "test5" ) -x-x-x- So ... all keys are LOST! Is this function BUGGY? How to maintain the keys? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19241&edit=1

« previous php.bugs (#18476) next »