3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $source = new \ArrayIterator([]); $toMerge = new \ArrayIterator(["a" => 1]); $iterator = new \AppendIterator; $iterator->append($source); $iterator->append($toMerge); var_dump($iterator);
based on LbUlK
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.6
object(AppendIterator)#3 (0) { }
Output for hhvm-3.15.4
object(AppendIterator)#3 (5) { ["iterators":"AppendIterator":private]=> object(ArrayIterator)#4 (2) { ["storage":"ArrayIterator":private]=> array(2) { [0]=> object(ArrayIterator)#1 (2) { ["storage":"ArrayIterator":private]=> array(0) { } ["flags":"ArrayIterator":private]=> int(0) } [1]=> object(ArrayIterator)#2 (2) { ["storage":"ArrayIterator":private]=> array(1) { ["a"]=> int(1) } ["flags":"ArrayIterator":private]=> int(0) } } ["flags":"ArrayIterator":private]=> int(0) } ["iterator":"IteratorIterator":private]=> NULL ["current":"IteratorIterator":private]=> NULL ["key":"IteratorIterator":private]=> NULL ["position":"IteratorIterator":private]=> NULL }