3v4l.org

run code in 300+ PHP versions simultaneously
$elapsed = microtime(true) - $start; var_dump($elapsed); $elapsed = microtime(true) - $start; var_dump($elapsed); <?php $a = range(0, 250_000); $b = range(250_000, 500_000); $start = microtime(true); foreach(array_merge($a, $b) as $key => $item){ // } $elapsed = microtime(true) - $start; var_dump($elapsed); $gen = function(array ...$input):iterable{foreach($input as $it) {yield from $it;}}; $start = microtime(true); foreach($gen($a, $b) as $key => $item){ // } $elapsed = microtime(true) - $start; var_dump($elapsed);

preferences:
24.82 ms | 407 KiB | 5 Q