3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "<pre>"; $array = array_fill(0, 10, range("A", "Z")); function getTests($array) { $it = new ArrayIterator($array); $tests = array(); foreach ( $it as $range ) { foreach ( array_chunk($range, 2) as $chunk ) { yield $chunk; } } } foreach(getTests($array) as $value) { print_r($value); } ?>

preferences:
37.68 ms | 402 KiB | 5 Q