3v4l.org

run code in 300+ PHP versions simultaneously
<?php $finish="a"; while($finish="a"){ $i = (mt_rand(0,999)); $counter = 0; for($j=1;$j<=$i;$j++){ //all divisible factors if($i % $j==0){ $counter++; } //prime requires 2 rules ( divisible by 1 and divisible by itself) if($counter==2){ print $i." is Prime <br/>"; $finish="b"; } } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0100.00719.36
7.1.70.0000.01016.80
7.1.60.0140.02119.40
7.1.50.0200.00734.61
7.0.200.0190.00414.84

preferences:
30.28 ms | 401 KiB | 5 Q