xref: /PHP-8.0/ext/spl/tests/bug75155.phpt (revision c2e3541c)
1--TEST--
2Bug #75155: AppendIterator::append() is broken when appending another AppendIterator
3--FILE--
4<?php
5
6$array_a = new ArrayIterator(array('a', 'b', 'c'));
7$array_b = new ArrayIterator(array('d', 'e', 'f'));
8
9$iterator = new AppendIterator;
10$iterator->append($array_a);
11
12$iterator2 = new AppendIterator;
13$iterator2->append($iterator);
14$iterator2->append($array_b);
15
16foreach ($iterator2 as $current) {
17    echo $current;
18}
19
20?>
21--EXPECT--
22abcdef
23