3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <script> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","q"); xmlhttp.send(); } </script> </head> <body> <form> <select name="users" onchange="showUser(this.value)"> <option value="">Select a person:</option> <option value="1">Peter Griffin</option> <option value="2">Lois Griffin</option> <option value="3">Joseph Swanson</option> <option value="4">Glenn Quagmire</option> </select> </form> <br> <div id="txtHint"><b>Person info will be listed here.</b></div> </body> </html> <?php $q = intval($_GET['q']); $con = mysqli_connect('localhost','peter','abc123','my_db'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"ajax_demo"); $sql="SELECT * FROM user WHERE id = '".$q."'"; $result = mysqli_query($con,$sql); echo "<table border='1'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> <th>Hometown</th> <th>Job</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "<td>" . $row['Age'] . "</td>"; echo "<td>" . $row['Hometown'] . "</td>"; echo "<td>" . $row['Job'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?>

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)
8.3.60.0110.00416.75
8.3.50.0080.01521.90
8.3.40.0120.00319.02
8.3.30.0070.00719.02
8.3.20.0000.00820.09
8.3.10.0000.00823.67
8.3.00.0000.00919.38
8.2.180.0150.00018.40
8.2.170.0110.00422.96
8.2.160.0110.00320.53
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0030.00326.16
8.2.120.0060.00321.99
8.2.110.0040.00420.45
8.2.100.0070.00717.91
8.2.90.0000.00817.63
8.2.80.0050.00317.97
8.2.70.0040.00418.05
8.2.60.0040.00418.03
8.2.50.0070.00718.07
8.2.40.0040.00418.16
8.2.30.0000.00718.11
8.2.20.0060.00317.80
8.2.10.0040.00418.14
8.2.00.0040.00717.82
8.1.280.0130.00325.92
8.1.270.0050.00323.87
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0030.00623.66
8.1.230.0050.00518.95
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0050.00317.48
8.1.190.0040.00417.64
8.1.180.0000.00818.10
8.1.170.0000.00818.67
8.1.160.0000.00822.12
8.1.150.0040.00418.57
8.1.140.0060.00317.45
8.1.130.0000.00717.76
8.1.120.0070.00017.45
8.1.110.0000.00817.43
8.1.100.0040.00417.40
8.1.90.0040.00417.52
8.1.80.0040.00417.42
8.1.70.0030.00317.34
8.1.60.0100.00317.67
8.1.50.0050.00317.54
8.1.40.0040.00417.60
8.1.30.0000.00817.63
8.1.20.0040.00417.62
8.1.10.0000.00717.51
8.1.00.0020.00517.58
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00718.42
8.0.270.0070.00017.37
8.0.260.0060.00017.23
8.0.250.0060.00017.11
8.0.240.0000.00717.06
8.0.230.0000.00717.11
8.0.220.0030.00317.05
8.0.210.0060.00017.01
8.0.200.0000.00617.09
8.0.190.0040.00416.98
8.0.180.0000.00717.02
8.0.170.0060.00317.07
8.0.160.0080.00016.89
8.0.150.0030.00417.08
8.0.140.0040.00416.97
8.0.130.0030.00313.43
8.0.120.0030.00517.06
8.0.110.0000.00717.01
8.0.100.0040.00416.82
8.0.90.0000.00716.90
8.0.80.0120.00416.96
8.0.70.0000.00716.79
8.0.60.0040.00417.00
8.0.50.0050.00216.89
8.0.30.0070.01017.34
8.0.20.0110.00717.40
8.0.10.0000.00717.15
8.0.00.0150.00616.86
7.4.330.0030.00315.00
7.4.320.0000.00616.63
7.4.300.0000.00616.57
7.4.290.0040.00416.43
7.4.280.0070.00016.47
7.4.270.0000.00816.65
7.4.260.0040.00416.47
7.4.250.0070.00016.63
7.4.240.0050.00216.56
7.4.230.0070.00016.77
7.4.220.0060.01316.52
7.4.210.0050.00916.67
7.4.200.0000.00716.56
7.4.190.0070.00016.74
7.4.160.0040.01316.47
7.4.150.0120.00817.40
7.4.140.0130.00717.86
7.4.130.0060.01116.58
7.4.120.0070.01416.61
7.4.110.0090.01016.68
7.4.100.0030.02016.46
7.4.90.0150.00316.73
7.4.80.0060.01019.39
7.4.70.0100.00616.54
7.4.60.0060.01216.69
7.4.50.0020.00216.36
7.4.40.0070.00722.77
7.4.30.0120.00616.51
7.4.00.0110.00414.83
7.3.330.0060.00013.09
7.3.320.0000.00513.21
7.3.310.0030.00516.22
7.3.300.0070.00016.34
7.3.290.0080.00516.39
7.3.280.0110.00916.32
7.3.270.0070.01017.40
7.3.260.0000.01716.35
7.3.250.0070.01116.50
7.3.240.0120.00616.37
7.3.230.0130.00416.41
7.3.210.0140.00316.44
7.3.200.0090.01319.39
7.3.190.0110.01116.46
7.3.180.0060.01016.45
7.3.170.0090.00616.35
7.3.160.0140.00716.53
7.3.120.0090.00614.78
7.2.330.0040.01416.85
7.2.320.0110.00916.61
7.2.310.0070.01016.66
7.2.300.0070.01016.66
7.2.290.0100.00616.71
7.2.60.0220.00516.44
7.2.00.0040.00819.45
7.1.200.0060.00615.87
7.1.100.0070.01018.29
7.1.70.0030.01017.14
7.1.60.0100.01419.33
7.1.50.0070.01616.85
7.1.00.0070.07322.54
7.0.200.0000.00716.82
7.0.140.0000.07722.07
7.0.100.0200.03719.95
7.0.90.0030.04719.96
7.0.80.0070.03720.00
7.0.70.0070.03720.14
7.0.60.0130.03719.99
7.0.50.0030.04320.32
7.0.40.0000.04320.18
7.0.30.0030.04320.00
7.0.20.0030.04320.04
7.0.10.0100.03320.02
7.0.00.0070.04720.14
5.6.280.0000.07720.90
5.6.250.0100.03320.61
5.6.240.0030.05020.71
5.6.230.0000.06720.64
5.6.220.0070.04020.62
5.6.210.0030.04020.49
5.6.200.0130.03321.09
5.6.190.0070.04321.12
5.6.180.0070.04021.14
5.6.170.0000.04321.14
5.6.160.0070.04021.02
5.6.150.0000.04321.02
5.6.140.0070.04021.03
5.6.130.0030.04321.02
5.6.120.0030.04321.02
5.6.110.0000.05021.07
5.6.100.0000.04721.03
5.6.90.0000.04721.02
5.6.80.0130.03720.33
5.6.70.0100.08020.39
5.6.60.0100.07020.33
5.6.50.0130.07720.56
5.6.40.0070.08020.32
5.6.30.0100.05720.42
5.6.20.0130.07020.39
5.6.10.0070.08020.43
5.6.00.0070.04320.46
5.5.380.0000.04320.50
5.5.370.0100.03320.36
5.5.360.0100.04720.54
5.5.350.0130.03020.46
5.5.340.0000.04720.79
5.5.330.0100.03720.77
5.5.320.0030.04020.81
5.5.310.0000.04720.80
5.5.300.0070.07320.87
5.5.290.0100.03320.87
5.5.280.0100.03720.89
5.5.270.0000.04320.88
5.5.260.0100.04020.82
5.5.250.0030.04320.60
5.5.240.0030.04720.16
5.5.230.0000.06720.28
5.5.220.0030.08020.30
5.5.210.0130.02720.30
5.5.200.0070.06320.27
5.5.190.0070.08320.23
5.5.180.0070.06720.00
5.5.160.0030.08020.28
5.5.150.0030.04720.00
5.5.140.0070.08020.27
5.5.130.0030.05320.13
5.5.120.0070.07720.15
5.5.110.0000.08020.15
5.5.100.0170.06320.17
5.5.90.0070.08320.09
5.5.80.0100.04320.09
5.5.70.0030.08720.20
5.5.60.0130.07720.11
5.5.50.0070.03720.04
5.5.40.0030.04720.06
5.5.30.0170.04320.09
5.5.20.0070.06720.05
5.5.10.0170.05319.93
5.5.00.0030.08020.05
5.4.450.0170.02319.14
5.4.440.0000.04319.36
5.4.430.0030.04019.28
5.4.420.0100.03319.39
5.4.410.0000.04018.98
5.4.400.0100.07718.90
5.4.390.0100.06719.09
5.4.380.0130.06719.13
5.4.370.0100.07718.96
5.4.360.0030.04319.17
5.4.350.0100.06318.97
5.4.340.0070.07319.09
5.4.320.0100.07319.13
5.4.310.0030.06019.04
5.4.300.0100.06318.80
5.4.290.0000.08319.05
5.4.280.0070.07719.12
5.4.270.0070.08019.22
5.4.260.0170.07019.11
5.4.250.0170.06018.94
5.4.240.0100.07318.96
5.4.230.0230.05018.80
5.4.220.0000.05019.14
5.4.210.0130.06719.02
5.4.200.0070.07319.11
5.4.190.0100.07319.11
5.4.180.0170.06719.05
5.4.170.0100.07718.80
5.4.160.0070.06019.12
5.4.150.0200.04719.05
5.4.140.0100.07316.23
5.4.130.0100.07016.32
5.4.120.0070.07316.07
5.4.110.0130.06716.21
5.4.100.0130.06316.26
5.4.90.0130.06316.23
5.4.80.0130.07316.17
5.4.70.0070.07016.39
5.4.60.0070.07316.42
5.4.50.0130.06316.24
5.4.40.0000.06716.46
5.4.30.0030.07716.29
5.4.20.0200.06316.39
5.4.10.0070.05716.41
5.4.00.0230.05715.67
5.3.290.0070.05714.67
5.3.280.0100.07014.47
5.3.270.0030.08314.62
5.3.260.0030.07014.48
5.3.250.0130.07314.48
5.3.240.0070.07714.60
5.3.230.0130.05714.61
5.3.220.0070.07314.58
5.3.210.0070.06714.55
5.3.200.0130.03714.50
5.3.190.0100.07014.44
5.3.180.0030.07014.43
5.3.170.0070.07714.55
5.3.160.0130.06714.52
5.3.150.0070.06014.44
5.3.140.0100.07314.49
5.3.130.0000.05014.55
5.3.120.0100.06714.41
5.3.110.0230.03014.50
5.3.100.0130.07314.05
5.3.90.0070.05014.02
5.3.80.0030.08013.98
5.3.70.0030.05313.93
5.3.60.0070.07013.97
5.3.50.0000.07713.82
5.3.40.0070.04713.96
5.3.30.0030.07713.91
5.3.20.0030.04313.57
5.3.10.0000.08013.65
5.3.00.0070.06013.41
5.2.170.0070.06011.84
5.2.160.0070.04011.84
5.2.150.0100.05711.84
5.2.140.0030.06711.84
5.2.130.0100.05311.84
5.2.120.0100.04311.84
5.2.110.0030.04311.84
5.2.100.0030.05011.84
5.2.90.0070.03311.84
5.2.80.0030.03311.84
5.2.70.0100.05711.84
5.2.60.0130.06011.84
5.2.50.0030.05311.84
5.2.40.0070.05311.84
5.2.30.0030.03711.84
5.2.20.0000.05011.84
5.2.10.0000.04711.84
5.2.00.0070.05011.84
5.1.60.0030.03011.84
5.1.50.0030.05311.84
5.1.40.0070.04311.84
5.1.30.0000.06011.84
5.1.20.0070.03711.84
5.1.10.0000.04011.84
5.1.00.0070.02311.84
5.0.50.0030.02711.84
5.0.40.0000.03011.84
5.0.30.0000.04711.84
5.0.20.0070.04011.84
5.0.10.0100.04011.84
5.0.00.0070.05311.84
4.4.90.0100.01011.84
4.4.80.0070.03311.84
4.4.70.0030.03311.84
4.4.60.0030.03311.84
4.4.50.0030.03311.84
4.4.40.0030.02711.84
4.4.30.0030.03311.84
4.4.20.0000.03311.84
4.4.10.0070.03011.84
4.4.00.0030.05311.84
4.3.110.0030.03311.84
4.3.100.0000.02711.84
4.3.90.0030.03711.84
4.3.80.0070.05011.84
4.3.70.0000.03711.84
4.3.60.0000.02711.84
4.3.50.0000.04011.84
4.3.40.0000.03011.84
4.3.30.0030.03311.84
4.3.20.0070.03011.84
4.3.10.0000.03711.84
4.3.00.0000.02311.84

preferences:
43.69 ms | 401 KiB | 5 Q