3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [['ONE'], ['TWO', 'THREE', 'FOUR'], ['FIVE']]; $iterator = new RecursiveIteratorIterator( new RecursiveArrayIterator( $array, RecursiveArrayIterator::CHILD_ARRAYS_ONLY ) ); $test = (function() { yield 'ONE'; yield from (function() { yield 'TWO'; yield 'THREE'; yield 'FOUR'; })(); yield 'FIVE'; })(); var_dump(iterator_to_array($test)); var_dump(iterator_to_array($iterator));
Output for git.master, git.master_jit
array(3) { [0]=> string(3) "TWO" [1]=> string(4) "FIVE" [2]=> string(4) "FOUR" } array(3) { [0]=> string(4) "FIVE" [1]=> string(5) "THREE" [2]=> string(4) "FOUR" }

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:
35.63 ms | 405 KiB | 5 Q