3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create connection $con=mysqli_connect('localhost','root','root','Test_DB'); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // This SQL statement selects ALL from the table 'Locations' $sql = "SELECT * FROM Locations"; // Check if there are results if ($result = mysqli_query($con, $sql)) { // If so, then create a results array and a temporary one // to hold the data $resultArray = array(); $tempArray = array(); // Loop through each row in the result set while($row = $result->fetch_object()) { // Add each row into our results array $tempArray = $row; array_push($resultArray, $tempArray); } // Finally, encode the array to JSON and output the results echo json_encode($resultArray); } // Close connections 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.70.0040.01416.58
8.3.60.0100.00716.60
8.3.50.0110.00721.07
8.3.40.0150.00018.54
8.3.30.0040.01118.83
8.3.20.0000.00920.34
8.3.10.0050.00223.74
8.3.00.0080.00019.68
8.2.180.0100.01016.63
8.2.170.0100.00322.96
8.2.160.0060.00920.44
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00417.38
8.2.110.0000.01120.53
8.2.100.0090.00317.75
8.2.90.0040.00419.27
8.2.80.0050.00317.97
8.2.70.0050.00317.63
8.2.60.0060.00617.65
8.2.50.0000.00818.07
8.2.40.0040.00419.14
8.2.30.0030.00320.56
8.2.20.0000.00717.64
8.2.10.0040.00417.89
8.2.00.0000.00818.00
8.1.280.0100.00725.92
8.1.270.0140.00723.79
8.1.260.0040.00426.35
8.1.250.0090.00928.09
8.1.240.0060.00323.96
8.1.230.0070.00417.42
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.13
8.1.190.0000.00817.13
8.1.180.0000.00718.10
8.1.170.0040.00418.50
8.1.160.0000.00821.94
8.1.150.0000.00718.70
8.1.140.0000.00817.33
8.1.130.0070.00017.60
8.1.120.0000.00717.23
8.1.110.0030.00517.39
8.1.100.0060.00317.36
8.1.90.0000.00717.22
8.1.80.0040.00417.30
8.1.70.0000.00817.26
8.1.60.0040.00417.56
8.1.50.0000.00817.38
8.1.40.0030.00517.39
8.1.30.0110.00017.54
8.1.20.0030.00517.47
8.1.10.0050.00317.63
8.1.00.0000.00717.52
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.41
8.0.270.0070.00017.09
8.0.260.0040.00417.13
8.0.250.0030.00316.95
8.0.240.0070.00016.89
8.0.230.0030.00316.85
8.0.220.0080.00016.92
8.0.210.0040.00416.88
8.0.200.0040.00417.02
8.0.190.0000.00917.04
8.0.180.0000.00716.98
8.0.170.0030.00616.89
8.0.160.0000.00717.00
8.0.150.0030.00316.69
8.0.140.0050.00316.84
8.0.130.0000.00613.36
8.0.120.0040.00416.83
8.0.110.0040.00416.91
8.0.100.0040.00416.73
8.0.90.0040.00416.87
8.0.80.0110.00316.88
8.0.70.0000.00716.82
8.0.60.0040.00416.96
8.0.50.0000.00816.87
8.0.30.0080.01117.00
8.0.20.0090.00917.40
8.0.10.0040.00417.03
8.0.00.0090.00916.68
7.4.330.0000.00515.08
7.4.320.0030.00316.27
7.4.300.0000.00716.42
7.4.290.0030.00616.56
7.4.280.0080.00316.45
7.4.270.0000.00716.46
7.4.260.0000.00716.44
7.4.250.0000.00816.55
7.4.240.0050.00316.46
7.4.230.0020.00516.59
7.4.220.0100.00716.41
7.4.210.0070.00816.42
7.4.200.0000.00716.64
7.4.160.0080.00816.50
7.4.150.0100.00717.40
7.4.140.0110.00817.86
7.4.130.0100.00716.52
7.4.120.0090.01216.51
7.4.110.0120.00816.47
7.4.100.0090.00816.55
7.4.90.0090.00916.53
7.4.80.0120.00519.39
7.4.70.0090.00916.65
7.4.60.0150.00616.58
7.4.50.0000.00816.42
7.4.40.0000.01516.50
7.4.30.0120.00716.47
7.4.00.0030.01414.64
7.3.330.0030.00313.13
7.3.320.0000.00613.13
7.3.310.0000.00716.24
7.3.300.0000.00716.33
7.3.290.0090.00716.27
7.3.280.0070.01216.33
7.3.270.0100.00717.40
7.3.260.0040.01216.57
7.3.250.0140.00416.31
7.3.240.0120.00616.24
7.3.230.0130.01016.39
7.3.210.0070.01816.18
7.3.200.0120.00316.43
7.3.190.0030.01316.52
7.3.180.0090.00616.32
7.3.170.0090.00916.27
7.3.160.0110.00616.50
7.2.330.0070.01016.58
7.2.320.0090.00916.21
7.2.310.0100.01316.58
7.2.300.0160.00016.62
7.2.290.0140.00316.57
7.2.60.0060.00916.68
7.2.00.0030.00919.25
7.1.200.0060.01015.64
7.1.100.0000.01618.24
7.1.70.0000.00717.16
7.1.60.0210.00319.50
7.1.50.0060.01234.29
7.1.00.0130.06722.34
7.0.200.0030.00616.55
7.0.90.0530.03319.95
7.0.80.0030.04019.92
7.0.70.0200.04319.93
7.0.60.0070.03720.06
7.0.50.0270.04020.27
7.0.40.0170.02720.14
7.0.30.0070.04320.15
7.0.20.0130.05320.17
7.0.10.0000.04319.99
7.0.00.0070.04320.14
5.6.280.0070.03021.02
5.6.240.0030.04020.67
5.6.230.0030.05720.70
5.6.220.0030.06320.56
5.6.210.0000.05320.59
5.6.200.0070.04021.04
5.6.190.0030.04020.95
5.6.180.0000.04321.03
5.6.170.0070.03720.95
5.6.160.0070.05021.04
5.6.150.0000.04721.13
5.6.140.0070.06021.10
5.6.130.0030.07021.09
5.6.120.0070.04021.02
5.6.110.0000.04721.16
5.6.100.0030.04021.00
5.6.90.0000.08321.14
5.6.80.0070.08020.30
5.6.70.0130.07320.38
5.6.60.0070.07720.53
5.6.50.0130.07320.48
5.6.40.0000.08320.40
5.6.30.0100.07020.32
5.6.20.0070.07720.33
5.6.10.0000.08020.30
5.6.00.0130.06720.45
5.5.380.0030.05720.36
5.5.370.0000.04720.32
5.5.360.0000.04720.29
5.5.350.0030.04020.37
5.5.340.0000.04020.90
5.5.330.0030.07720.73
5.5.320.0030.03720.77
5.5.310.0000.04320.92
5.5.300.0030.04020.80
5.5.290.0070.03720.91
5.5.280.0070.03720.90
5.5.270.0030.04320.75
5.5.260.0070.04320.91
5.5.250.0030.09020.61
5.5.240.0100.04720.30
5.5.230.0170.06720.21
5.5.220.0070.07320.13
5.5.210.0000.07320.22
5.5.200.0070.04320.14
5.5.190.0100.07020.12
5.5.180.0130.07020.27
5.5.160.0130.07020.28
5.5.150.0070.05320.21
5.5.140.0130.04020.18
5.5.130.0000.07019.99
5.5.120.0030.07320.20
5.5.110.0100.04320.14
5.5.100.0070.04320.10
5.5.90.0100.07320.04
5.5.80.0170.02720.07
5.5.70.0070.07320.06
5.5.60.0100.07020.16
5.5.50.0030.07720.10
5.5.40.0100.07020.00
5.5.30.0070.07320.10
5.5.20.0070.07719.98
5.5.10.0070.03720.00
5.5.00.0100.04320.03
5.4.450.0000.04319.14
5.4.440.0030.04019.44
5.4.430.0000.04319.42
5.4.420.0030.08019.45
5.4.410.0070.04319.31
5.4.400.0070.07318.95
5.4.390.0130.06319.18
5.4.380.0100.04018.81
5.4.370.0100.06719.12
5.4.360.0100.07318.90
5.4.350.0030.07319.07
5.4.340.0070.08018.81
5.4.320.0100.07318.90
5.4.310.0170.03319.03
5.4.300.0200.06319.07
5.4.290.0030.06319.08
5.4.280.0030.07718.80
5.4.270.0100.07019.11
5.4.260.0130.03719.05
5.4.250.0100.07318.77
5.4.240.0100.06319.11
5.4.230.0070.08319.11
5.4.220.0000.05318.92
5.4.210.0170.06319.07
5.4.200.0070.07719.16
5.4.190.0100.06319.12
5.4.180.0030.04019.01
5.4.170.0070.07719.05
5.4.160.0070.07319.03
5.4.150.0100.06019.02
5.4.140.0070.04016.30
5.4.130.0070.04316.32
5.4.120.0030.07716.22
5.4.110.0100.06716.21
5.4.100.0070.07016.38
5.4.90.0070.04316.30
5.4.80.0200.06316.29
5.4.70.0070.05316.34
5.4.60.0000.08016.30
5.4.50.0100.07016.23
5.4.40.0000.08316.36
5.4.30.0070.04716.33
5.4.20.0130.07016.27
5.4.10.0070.07316.45
5.4.00.0130.06715.73

preferences:
64.91 ms | 401 KiB | 5 Q