3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; for($i = 0; 9999 > $i; $i++){ $array[] = $i; } $startTimeForLoop = time(); foreach($array as $key => $value){ $foo = 'bar'; } echo time()-$startTimeForLoop; echo '<br>'; $startTimeForEnd = time(); var_dump(end($array)); echo time()-$startTimeForEnd;

preferences:
39.94 ms | 402 KiB | 5 Q