3v4l.org

run code in 300+ PHP versions simultaneously
<?php const START=0; const NUM=1000; const NEST=1000; for($i = START; $i < NUM; $i += 1) { $a[$i] = TRUE; } $start = microtime(TRUE); for($n = 0; $n < NEST; $n++) { for($i = START; $i < NUM; $i += 1) { $a[$i]; } } echo 'Time: '.(microtime(TRUE) - $start).PHP_EOL; $start = microtime(TRUE); for($n = 0; $n < NEST; $n++) { for($i = START; $i < NUM; $i += 1) { //$a[$i]; } } echo 'Time: '.(microtime(TRUE) - $start).PHP_EOL;

preferences:
23.95 ms | 404 KiB | 5 Q