Skip to content

Commit c2e3541

Browse files
committed
Add test for bug #75155
1 parent b689857 commit c2e3541

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ PHP NEWS
2020
. Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized
2121
before PHP-FPM sets it up). (Ingmar Runge)
2222

23+
- SPL:
24+
. Fixed bug #75155 (AppendIterator::append() is broken when appending another
25+
AppendIterator). (Nikita)
26+
2327
- Standard:
2428
. Fixed bug #75097 (gethostname fails if your host name is 64 chars long). (Andrea)
2529

ext/spl/tests/bug75155.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Bug #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+
16+
foreach ($iterator2 as $current) {
17+
echo $current;
18+
}
19+
20+
?>
21+
--EXPECT--
22+
abcdef

0 commit comments

Comments
 (0)