|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-03-31 04:32 UTC] laruence@php.net
-Assigned To:
+Assigned To: laruence
[2015-04-01 03:23 UTC] laruence@php.net
-Status: Assigned
+Status: Suspended
[2015-04-01 03:23 UTC] laruence@php.net
[2017-09-12 14:29 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
Description: ------------ with the new Hashtable implementation.. follows script doesn't works as before: anyway, I don't see a good way to fix it (using HashTableIterator is expensive here, and may introduce performance issue for later foreach calls) I'd like add a test script, and mark it as XFAIL, linked to this entry. Test script: --------------- <?php $a = array(1=>1, 3=>3, 5=>5, 7=>7); $a = new ArrayObject($a); foreach ($a as $k => $v) { var_dump("$k => $v"); if ($k == 3) { $a['a'] = "?"; } } ?> Expected result: ---------------- string(6) "1 => 1" string(6) "3 => 3" string(6) "5 => 5" string(6) "7 => 7" string(6) "a => ?" Actual result: -------------- string(6) "1 => 1" string(6) "3 => 3" PHP Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in /tmp/1.php on line 5 Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in /tmp/1.php on line 5 string(6) "1 => 1" string(6) "3 => 3" string(6) "5 => 5" string(6) "7 => 7" string(6) "a => ?"