|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-05-02 04:38 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2014-05-02 04:38 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
Description: ------------ When using array_shift() on an array and then adding new elements in it, the index is incremented in a wrong way. this behavior differs from previous PHP versions (working in PHP 5.6-alpha1, broken in beta1 and beta2) Test script: --------------- <?php $a = array(); $a[] = 1; var_dump(array_keys($a)); array_shift($a); $a[] = 1; var_dump(array_keys($a)); Expected result: ---------------- array(1) { [0]=> int(0) } array(1) { [0]=> int(0) } Actual result: -------------- array(1) { [0]=> int(0) } array(1) { [0]=> int(1) }