3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function iterator_compose() { foreach (array_reverse(func_get_args()) as $it) { if (is_callable($it)) { $prev = $it; } } } function iterator_chunk($it, $chunkSize) { $chunk = []; $i = 0; foreach ($it as $val) { $chunk[] = $val; $i++; if ($i === $chunkSize) { yield $chunk; $chunk = []; $i = 0; } } } foreach (iterator_chunk(range(0, 128), 32) as $c) { var_export($c); }

preferences:
55.52 ms | 402 KiB | 5 Q