3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterator = new \AppendIterator(); $inner1 = new AppendIterator(); $inner1->append(new ArrayIterator([1, 2, 3])); $iterator->append($inner1); $iterator->append(new ArrayIterator([11, 12, 13])); echo "-> iteration", "\n"; while($iterator->valid()) { echo $iterator->current(), "\n"; $iterator->next(); } echo "-> foreach", "\n"; foreach($iterator as $val) { echo $val, "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
-> iteration 1 2 3 11 12 13 -> foreach 1 2 3 11 12 13

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
79.85 ms | 401 KiB | 8 Q