diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-09-04 21:23:07 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-09-04 21:23:07 +0200 |
commit | c2e3541cc1200f38f72deccac66d889888e3949d (patch) | |
tree | 219ccd92c09c35eb10a1bf6efbea8489a74317dc | |
parent | b689857d53177b6027679f67fecbde8f36c174d1 (diff) | |
download | php-git-c2e3541cc1200f38f72deccac66d889888e3949d.tar.gz |
Add test for bug #75155
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/spl/tests/bug75155.phpt | 22 |
2 files changed, 26 insertions, 0 deletions
@@ -20,6 +20,10 @@ PHP NEWS . Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized before PHP-FPM sets it up). (Ingmar Runge) +- SPL: + . Fixed bug #75155 (AppendIterator::append() is broken when appending another + AppendIterator). (Nikita) + - Standard: . Fixed bug #75097 (gethostname fails if your host name is 64 chars long). (Andrea) diff --git a/ext/spl/tests/bug75155.phpt b/ext/spl/tests/bug75155.phpt new file mode 100644 index 0000000000..0d0c0753e0 --- /dev/null +++ b/ext/spl/tests/bug75155.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #75155: AppendIterator::append() is broken when appending another AppendIterator +--FILE-- +<?php + +$array_a = new ArrayIterator(array('a', 'b', 'c')); +$array_b = new ArrayIterator(array('d', 'e', 'f')); + +$iterator = new AppendIterator; +$iterator->append($array_a); + +$iterator2 = new AppendIterator; +$iterator2->append($iterator); +$iterator2->append($array_b); + +foreach ($iterator2 as $current) { + echo $current; +} + +?> +--EXPECT-- +abcdef |