3v4l.org

run code in 300+ PHP versions simultaneously
<?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.0000.01518.55
8.3.50.0040.01418.30
8.3.40.0120.00618.79
8.3.30.0110.00319.04
8.3.20.0000.00820.29
8.3.10.0070.00022.02
8.3.00.0050.00222.43
8.2.180.0150.00317.00
8.2.170.0070.00722.96
8.2.160.0110.00419.15
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00419.49
8.2.110.0000.00922.06
8.2.100.0070.00417.84
8.2.90.0040.00417.75
8.2.80.0060.00317.97
8.2.70.0030.00518.03
8.2.60.0000.00818.05
8.2.50.0040.00418.10
8.2.40.0040.00420.28
8.2.30.0030.00618.04
8.2.20.0000.00717.68
8.2.10.0000.00717.70
8.2.00.0000.00917.82
8.1.270.0050.00523.98
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0030.00623.97
8.1.230.0110.00019.11
8.1.220.0040.00417.77
8.1.210.0030.00618.77
8.1.200.0000.00917.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0030.00518.72
8.1.160.0040.00422.04
8.1.150.0040.00418.75
8.1.140.0030.00617.37
8.1.130.0040.00417.68
8.1.120.0000.00717.50
8.1.110.0000.00717.46
8.1.100.0040.00417.45
8.1.90.0000.00717.46
8.1.80.0080.00017.52
8.1.70.0000.00717.50
8.1.60.0030.00517.46
8.1.50.0040.00417.54
8.1.40.0040.00417.49
8.1.30.0000.00817.63
8.1.20.0040.00417.69
8.1.10.0040.00417.66
8.1.00.0060.00317.54
8.0.300.0070.00019.78
8.0.290.0030.00616.63
8.0.280.0070.00018.50
8.0.270.0050.00217.27
8.0.260.0080.00016.94
8.0.250.0000.00716.95
8.0.240.0040.00417.02
8.0.230.0030.00617.05
8.0.220.0070.00016.97
8.0.210.0050.00217.02
8.0.200.0040.00417.06
8.0.190.0000.00717.04
8.0.180.0040.00416.93
8.0.170.0040.00416.98
8.0.160.0050.00217.02
8.0.150.0000.00716.94
8.0.140.0000.00716.77
8.0.130.0060.00013.45
8.0.120.0000.00716.82
8.0.110.0040.00416.96
8.0.100.0030.00516.87
8.0.90.0040.00417.04
8.0.80.0090.00616.96
8.0.70.0000.00717.02
8.0.60.0050.00316.96
8.0.50.0070.00016.86
8.0.30.0050.01717.27
8.0.20.0090.00917.40
8.0.10.0000.00716.96
8.0.00.0050.01316.86
7.4.330.0000.00515.15
7.4.320.0030.00316.63
7.4.300.0080.00016.58
7.4.290.0070.00016.51
7.4.280.0000.00716.60
7.4.270.0000.00716.50
7.4.260.0070.00016.40
7.4.250.0000.00816.34
7.4.240.0050.00216.62
7.4.230.0030.00316.43
7.4.220.0090.00916.55
7.4.210.0060.00916.65
7.4.200.0000.00716.44
7.4.190.0000.00816.51
7.4.160.0090.00916.57
7.4.150.0110.00617.40
7.4.140.0100.01217.86
7.4.130.0090.01016.70
7.4.120.0130.00316.57
7.4.110.0150.00916.54
7.4.100.0070.01016.80
7.4.90.0070.01016.71
7.4.80.0000.01719.39
7.4.70.0150.00316.32
7.4.60.0000.01616.53
7.4.50.0000.00816.44
7.4.40.0060.00922.77
7.4.30.0060.01016.46
7.4.00.0100.00315.14
7.3.330.0050.00013.25
7.3.320.0000.00513.23
7.3.310.0030.00516.31
7.3.300.0030.00316.38
7.3.290.0030.01016.30
7.3.280.0060.01116.40
7.3.270.0060.01117.40
7.3.260.0100.01316.49
7.3.250.0110.00616.40
7.3.240.0150.00916.38
7.3.230.0150.00316.39
7.3.210.0110.00716.38
7.3.200.0040.01819.39
7.3.190.0060.01216.52
7.3.180.0080.00916.36
7.3.170.0060.00916.38
7.3.160.0100.00616.38
7.3.120.0060.01214.98
7.2.330.0190.00016.38
7.2.320.0070.01016.67
7.2.310.0100.00716.58
7.2.300.0100.00716.33
7.2.290.0150.00316.73
7.2.60.0070.00317.03
7.2.00.0000.01019.16
7.1.200.0040.01115.99
7.1.100.0000.01318.14
7.1.70.0070.00716.85
7.1.60.0130.01019.82
7.1.50.0130.01016.93
7.1.00.0070.07322.35
7.0.200.0000.01016.86
7.0.140.0030.07321.95
7.0.60.0170.07020.08
7.0.50.0100.07717.66
7.0.40.0070.08719.91
7.0.30.0530.06720.34
7.0.20.0300.04320.12
7.0.10.0030.09020.17
7.0.00.0070.08320.17
5.6.280.0100.06721.11
5.6.210.0170.06020.71
5.6.200.0070.05318.19
5.6.190.0130.03720.35
5.6.180.3430.04720.28
5.6.170.0330.07020.71
5.6.160.0130.07320.48
5.6.150.0070.08318.20
5.6.140.0000.04018.21
5.6.130.0100.07318.21
5.6.120.0100.04020.99
5.6.110.0070.08720.99
5.6.100.0100.07721.09
5.6.90.0030.04720.88
5.6.80.0070.07720.36
5.6.70.0400.06020.37
5.5.350.0330.08320.42
5.5.340.0070.08317.97
5.5.330.0030.05020.23
5.5.320.0270.04320.21
5.5.310.0270.08720.34
5.5.300.0100.03717.84
5.5.290.0070.05317.89
5.5.280.0000.05320.97
5.5.270.0230.07020.73
5.5.260.0100.04020.87
5.5.250.0030.07720.70
5.5.240.0430.04320.23
5.4.450.0200.06319.37
5.4.440.0270.07319.11
5.4.430.0200.07019.40
5.4.420.0200.04319.54
5.4.410.0170.04718.98
5.4.400.0200.03718.94
5.4.390.0170.08319.26
5.4.380.0270.05319.13
5.4.370.0300.06719.18
5.4.360.0330.06319.08
5.4.350.0300.06718.93
5.4.340.0170.04718.80
5.4.320.0200.03719.24
5.4.310.0230.07018.92
5.4.300.0230.07718.88
5.4.290.0300.06319.22
5.4.280.0300.06719.13
5.4.270.0370.06319.21
5.4.260.0270.03318.91
5.4.250.0330.06718.91
5.4.240.0200.05718.88
5.4.230.0270.07019.09
5.4.220.0270.06319.08
5.4.210.0200.07018.91
5.4.200.0230.03319.12
5.4.190.0300.04319.23
5.4.180.0300.05719.08
5.4.170.0230.07019.09
5.4.160.0230.06719.11
5.4.150.0300.06719.22
5.4.140.0230.07016.38
5.4.130.0230.05716.43
5.4.120.0230.03716.18
5.4.110.0200.06716.30
5.4.100.0200.07016.43
5.4.90.0300.05316.23
5.4.80.0200.07016.39
5.4.70.0200.07016.20
5.4.60.0200.07016.38
5.4.50.0130.04716.38
5.4.40.0300.06316.04
5.4.30.0130.05316.45
5.4.20.0300.06316.38
5.4.10.0200.04716.38
5.4.00.0270.06315.82
5.3.290.0330.06014.62
5.3.280.0200.06314.48
5.3.270.0230.04314.57
5.3.260.0130.06314.49
5.3.250.0330.02314.45
5.3.240.0270.07014.49
5.3.230.0230.07314.56
5.3.220.0230.06714.53
5.3.210.0230.07714.41
5.3.200.0230.05714.43
5.3.190.0100.05714.42
5.3.180.0170.03714.52
5.3.170.0130.04014.43
5.3.160.0230.06314.41
5.3.150.0300.05714.45
5.3.140.0070.05014.59
5.3.130.0230.05014.43
5.3.120.0300.06014.49
5.3.110.0230.05014.39
5.3.100.0230.05314.11
5.3.90.0200.05314.11
5.3.80.0200.05014.11
5.3.70.0300.03714.11
5.3.60.0200.07014.11
5.3.50.0270.04014.11
5.3.40.0230.07314.11
5.3.30.0300.04714.11
5.3.20.0130.04014.11
5.3.10.0100.06014.11
5.3.00.0270.04014.11
5.2.170.0200.05714.11
5.2.160.0270.02314.11
5.2.150.0230.03314.11
5.2.140.0170.03014.11
5.2.130.0100.04714.11
5.2.120.0130.03714.11
5.2.110.0170.03714.11
5.2.100.0230.05314.11
5.2.90.0200.04714.11
5.2.80.0130.04314.11
5.2.70.0100.03714.11
5.2.60.0270.05314.11
5.2.50.0230.05314.11
5.2.40.0200.05314.11
5.2.30.0130.06314.11
5.2.20.0170.04714.11
5.2.10.0100.06014.11
5.2.00.0230.03014.11
5.1.60.0230.04014.11
5.1.50.0130.05714.11
5.1.40.0170.02014.11
5.1.30.0130.05714.11
5.1.20.0130.02714.11
5.1.10.0200.05014.11
5.1.00.0170.05014.11
5.0.50.0100.02714.11
5.0.40.0100.02314.11
5.0.30.0100.06714.11
5.0.20.0070.04714.11
5.0.10.0030.03314.11
5.0.00.0130.06014.11
4.4.90.0070.01714.11
4.4.80.0130.03014.11
4.4.70.0070.02314.11
4.4.60.0130.01714.11
4.4.50.0130.02014.11
4.4.40.0030.03714.11
4.4.30.0070.02014.11
4.4.20.0070.03714.11
4.4.10.0070.03314.11
4.4.00.0100.03314.11
4.3.110.0070.03014.11
4.3.100.0070.02014.11
4.3.90.0070.03014.11
4.3.80.0070.02714.11
4.3.70.0030.01714.11
4.3.60.0070.03014.11
4.3.50.0000.02314.11
4.3.40.0100.05014.11
4.3.30.0030.02314.11
4.3.20.0070.03714.11
4.3.10.0100.03314.11
4.3.00.0030.03714.11

preferences:
54.94 ms | 400 KiB | 5 Q