|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-07-13 10:50 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2020-07-13 10:50 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Description: ------------ No hidden state should be used for next index. In example below, empty array is set and cleared immediatelly. When array is clear, next index should be 0 like when the 2nd (set/clear) line would not be presented. Test script: --------------- $a = []; $a[] = 'x'; unset($a[0]); // this should have zero effect $a[] = 5; // but it has, this value is added under index 1 instead of 0 print_r($a); Expected result: ---------------- Array ( [0] => 5 ) Actual result: -------------- Array ( [1] => 5 )