3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = range(0, 50000); $n = 300; $t = microtime(true); for ($i = 0; $i < $n; $i++) { foreach ($array as $v) { } } var_dump(microtime(true) - $t); $t = microtime(true); for ($i = 0; $i < $n; $i++) { for ($j = 0, $c = count($array); $j < $c; $j++) { $v = $array[$j]; } } var_dump(microtime(true) - $t);

preferences:
27.39 ms | 402 KiB | 5 Q