Bug #75173 [Asn->Csd]: incorrect behavior of AppendIterator::append in foreach loop
| From: | krakjoe@php.net | Date: | Tue, 12 Sep 2017 06:08:57 +0000 |
| Subject: | Bug #75173 [Asn->Csd]: incorrect behavior of AppendIterator::append in foreach loop | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-211084@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75173&edit=1
ID: 75173
Updated by: krakjoe@php.net
Reported by: gharlan at web dot de
Summary: incorrect behavior of AppendIterator::append in
foreach loop
-Status: Assigned
+Status: Closed
Type: Bug
Package: SPL related
PHP Version: 7.0.23
Assigned To: jhdxr
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3e11b7fc217ee3ce7a3a2833a062d73537cf6bcc
Log: fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop
Previous Comments:
------------------------------------------------------------------------
[2017-09-08 10:30:03] gharlan at web dot de
Description:
------------
https://3v4l.org/itLi1
I guess the change was introduced by https://github.com/php/php-src/pull/2499
Test script:
---------------
<?php
$it = new \AppendIterator();
$it->append(new ArrayIterator(['foo']));
foreach ($it as $item) {
echo $item;
if ('foo' === $item) {
$it->append(new ArrayIterator(['bar']));
}
}
Expected result:
----------------
foobar
Actual result:
--------------
foo
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75173&edit=1