summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug75173.phpt
blob: fa5d2ac3716151c5822d7d078806611eb3bd974d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--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"