#19241 [NEW]: array_pop reorders index
| From: | oliver dot neumann at newidentity dot de | Date: | Thu, 05 Sep 2002 08:50:08 +0000 |
| Subject: | #19241 [NEW]: array_pop reorders index | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-18475@lists.php.net to get a copy of this message | ||
From: oliver.neumann@newidentity.de
Operating system: Linux
PHP version: 4.1.2
PHP Bug Type: Arrays related
Bug description: array_pop reorders index
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 bug report at http://bugs.php.net/?id=19241&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19241&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19241&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19241&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19241&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19241&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19241&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19241&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19241&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19241&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19241&r=globals