Bug #69335 [Asn->Sus]: SplArray BC break
| From: | laruence@php.net | Date: | Wed, 01 Apr 2015 03:23:46 +0000 |
| Subject: | Bug #69335 [Asn->Sus]: SplArray BC break | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191759@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69335&edit=1
ID: 69335
Updated by: laruence@php.net
Reported by: laruence@php.net
Summary: SplArray BC break
-Status: Assigned
+Status: Suspended
Type: Bug
Package: SPL related
PHP Version: master-Git-2015-03-31 (snap)
Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
marked as suspend for now
Previous Comments:
------------------------------------------------------------------------
[2015-03-31 03:52:27] laruence@php.net
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 => ?"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69335&edit=1