|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-03 20:06 UTC] eru@php.net
[2002-07-03 20:29 UTC] david at acz dot org
[2002-07-03 21:16 UTC] eru@php.net
[2011-08-23 14:27 UTC] datibbaw@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: datibbaw
[2011-08-23 14:27 UTC] datibbaw@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Jan 17 02:00:01 2026 UTC |
The array_slice function destroys keys that are numeric (even if used as strings), but not string keys. This is a serious bug, which makes the function unusable. I had to write my own function to correctly take the slice of an array. If this is indeed intended behavior, then it should be noted as such in the manual, and a new function added to take array slices that does not destroy numeric keys. <? $a = array("7" => "foo", "f" => "bar", "13" => "blah"); print_r($a); print_r(array_slice($a, 0)); ?> Array ( [7] => foo [f] => bar [13] => blah ) Array ( [0] => foo [f] => bar [1] => blah )