1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 03:32:20 +02:00
Files
archived-php-src/ext/spl/tests/bug75173.phpt

19 lines
347 B
PHP

--TEST--
Bug #75173 incorrect behavior of AppendIterator::append in foreach loop
--FILE--
<?php
$it = new \AppendIterator();
$it->append(new ArrayIterator(['foo']));
foreach ($it as $item) {
var_dump($item);
if ('foo' === $item) {
$it->append(new ArrayIterator(['bar']));
}
}
--EXPECT--
string(3) "foo"
string(3) "bar"