3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create connection $con=mysqli_connect("localhost","username","password","dbname"); // 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.60.0070.01116.50
8.3.50.0090.00921.04
8.3.40.0070.00718.69
8.3.30.0090.00618.73
8.3.20.0040.00420.34
8.3.10.0040.00421.90
8.3.00.0090.00019.57
8.2.180.0090.00618.50
8.2.170.0100.00322.96
8.2.160.0140.00020.52
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0040.00717.63
8.2.110.0060.00320.43
8.2.100.0070.00717.72
8.2.90.0040.00419.21
8.2.80.0000.01017.97
8.2.70.0040.00417.50
8.2.60.0080.00418.02
8.2.50.0040.00418.07
8.2.40.0050.00319.37
8.2.30.0030.00520.54
8.2.20.0040.00417.58
8.2.10.0060.00318.01
8.2.00.0030.00517.88
8.1.280.0060.00925.92
8.1.270.0100.01023.77
8.1.260.0030.00626.35
8.1.250.0190.00028.09
8.1.240.0060.00322.19
8.1.230.0080.00419.00
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0030.00717.23
8.1.190.0040.00417.11
8.1.180.0000.00818.10
8.1.170.0040.00418.51
8.1.160.0000.00821.98
8.1.150.0030.00618.71
8.1.140.0050.00317.35
8.1.130.0030.00617.56
8.1.120.0080.00017.44
8.1.110.0000.00717.36
8.1.100.0000.00717.41
8.1.90.0040.00417.35
8.1.80.0040.00417.27
8.1.70.0030.00317.31
8.1.60.0000.00817.45
8.1.50.0070.00017.48
8.1.40.0030.00617.41
8.1.30.0040.00817.61
8.1.20.0040.00417.64
8.1.10.0040.00417.48
8.1.00.0000.00717.36
8.0.300.0060.00318.77
8.0.290.0040.00416.63
8.0.280.0000.00718.41
8.0.270.0000.00717.23
8.0.260.0040.00417.22
8.0.250.0070.00017.03
8.0.240.0000.00816.97
8.0.230.0000.00716.89
8.0.220.0030.00516.96
8.0.210.0030.00516.79
8.0.200.0040.00416.97
8.0.190.0040.00416.99
8.0.180.0040.00416.93
8.0.170.0080.00016.91
8.0.160.0050.00316.91
8.0.150.0000.00716.73
8.0.140.0070.00016.89
8.0.130.0000.00613.30
8.0.120.0000.00816.78
8.0.110.0000.00716.91
8.0.100.0000.00816.97
8.0.90.0080.00016.89
8.0.80.0120.00616.98
8.0.70.0080.00016.91
8.0.60.0030.00616.96
8.0.50.0070.00016.88
8.0.30.0090.00917.14
8.0.20.0140.00517.40
8.0.10.0050.00216.95
8.0.00.0120.00416.76
7.4.330.0030.00315.08
7.4.320.0060.00016.36
7.4.300.0000.00616.52
7.4.290.0030.00616.47
7.4.280.0070.00316.56
7.4.270.0070.00016.42
7.4.260.0000.00716.39
7.4.250.0040.00416.29
7.4.240.0040.00416.46
7.4.230.0000.00716.67
7.4.220.0120.00916.60
7.4.210.0000.01716.58
7.4.200.0070.00016.57
7.4.160.0120.00316.37
7.4.150.0030.01417.40
7.4.140.0140.00817.86
7.4.130.0100.00816.55
7.4.120.0120.00616.51
7.4.110.0060.01016.52
7.4.100.0070.01516.35
7.4.90.0130.00916.41
7.4.80.0160.01019.39
7.4.70.0110.00616.45
7.4.60.0000.01716.59
7.4.50.0040.00416.47
7.4.40.0060.01016.66
7.4.30.0120.00616.22
7.4.10.0100.00614.75
7.4.00.0090.01014.90
7.3.330.0050.00013.04
7.3.320.0000.00513.11
7.3.310.0030.00316.38
7.3.300.0030.00316.30
7.3.290.0110.00416.25
7.3.280.0080.01016.31
7.3.270.0100.00717.40
7.3.260.0070.01016.23
7.3.250.0110.01816.28
7.3.240.0090.00916.46
7.3.230.0130.00316.39
7.3.210.0170.00616.49
7.3.200.0100.00716.38
7.3.190.0120.00616.19
7.3.180.0090.00616.28
7.3.170.0090.01316.66
7.3.160.0160.00016.23
7.3.130.0100.01014.78
7.3.120.0030.01514.88
7.3.110.0050.01314.94
7.3.100.0030.01314.80
7.3.90.0050.00814.82
7.3.80.0050.01014.80
7.3.70.0060.00614.85
7.3.60.0020.01114.72
7.3.50.0080.00714.62
7.3.40.0050.01014.61
7.3.30.0090.00714.65
7.3.20.0050.00916.68
7.3.10.0050.00716.45
7.3.00.0030.00716.62
7.2.330.0160.00716.50
7.2.320.0060.01116.27
7.2.310.0000.01616.59
7.2.300.0140.00316.51
7.2.290.0070.01016.48
7.2.260.0030.01515.20
7.2.250.0080.00714.98
7.2.240.0100.00714.96
7.2.230.0050.01014.98
7.2.220.0080.00614.75
7.2.210.0060.01014.87
7.2.200.0100.00514.75
7.2.190.0100.00714.90
7.2.180.0080.00814.97
7.2.170.0110.00614.83
7.2.160.0050.00714.83
7.2.150.0050.01016.88
7.2.140.0050.00716.76
7.2.130.0090.00516.75
7.2.120.0050.01016.67
7.2.110.0110.00516.81
7.2.100.0080.00816.47
7.2.90.0020.01516.90
7.2.80.0040.00916.69
7.2.70.0070.00716.73
7.2.60.0060.00616.62
7.2.50.0070.00716.82
7.2.40.0030.00816.77
7.2.30.0070.00616.68
7.2.20.0100.00016.73
7.2.10.0080.00716.76
7.2.00.0080.00617.67
7.1.330.0020.01315.48
7.1.320.0070.00515.70
7.1.310.0060.00615.80
7.1.300.0080.00515.66
7.1.290.0040.01115.47
7.1.280.0030.01015.64
7.1.270.0050.00715.42
7.1.260.0000.01315.70
7.1.250.0040.01115.56
7.1.240.0030.00915.51
7.1.230.0020.01515.54
7.1.220.0020.00915.69
7.1.210.0050.00915.64
7.1.200.0020.00915.47
7.1.190.0020.01115.48
7.1.180.0050.00615.42
7.1.170.0070.00515.66
7.1.160.0060.00615.51
7.1.150.0050.00815.52
7.1.140.0040.00715.49
7.1.130.0020.01415.56
7.1.120.0020.01315.60
7.1.110.0060.00715.72
7.1.100.0020.01116.26
7.1.90.0020.00915.57
7.1.80.0010.01115.64
7.1.70.0050.00616.15
7.1.60.0030.01416.96
7.1.50.0040.01215.93
7.1.40.0050.00715.67
7.1.30.0040.00815.62
7.1.20.0070.00615.50
7.1.10.0030.01015.57
7.1.00.0060.02817.89
7.0.330.0060.00515.30
7.0.320.0080.00515.00
7.0.310.0050.00815.27
7.0.300.0050.00915.05
7.0.290.0050.00715.27
7.0.280.0020.00915.30
7.0.270.0030.00915.12
7.0.260.0040.00615.28
7.0.250.0070.00515.33
7.0.240.0040.00915.47
7.0.230.0110.00415.26
7.0.220.0080.00515.35
7.0.210.0050.00915.10
7.0.200.0050.00815.79
7.0.190.0070.00515.20
7.0.180.0070.00615.33
7.0.170.0070.00415.28
7.0.160.0070.00615.33
7.0.150.0040.01015.21
7.0.140.0060.00915.07
7.0.130.0030.00815.39
7.0.120.0050.00415.30
7.0.110.0030.01115.31
7.0.100.0050.00915.48
7.0.90.0030.02416.87
7.0.80.0070.03116.93
7.0.70.0090.01716.87
7.0.60.0100.02816.85
7.0.50.0050.02216.96
7.0.40.0060.03015.62
7.0.30.0090.03215.64
7.0.20.0040.03415.50
7.0.10.0040.02215.63
7.0.00.0020.02715.61
5.6.400.0050.00714.34
5.6.390.0050.00613.96
5.6.380.0070.00714.18
5.6.370.0080.00514.23
5.6.360.0050.01013.97
5.6.350.0040.00814.22
5.6.340.0080.00513.98
5.6.330.0050.01014.02
5.6.320.0030.01014.14
5.6.310.0080.00614.06
5.6.300.0020.01014.05
5.6.290.0060.00913.95
5.6.280.0070.01216.51
5.6.270.0080.00614.21
5.6.260.0050.00814.24
5.6.250.0030.00714.14
5.6.240.0060.02316.38
5.6.230.0040.03416.28
5.6.220.0070.03016.25
5.6.210.0090.01916.19
5.6.200.0050.01916.37
5.6.190.0070.03116.47
5.6.180.0080.02916.42
5.6.170.0100.02716.48
5.6.160.0070.03016.47
5.6.150.0070.03016.43
5.6.140.0110.03016.37
5.6.130.0040.02216.45
5.6.120.0080.02216.32
5.6.110.0080.02916.27
5.6.100.0040.03616.51
5.6.90.0110.03016.35
5.6.80.0090.02516.25
5.6.70.0030.02616.07
5.6.60.0090.02816.16
5.6.50.0060.02416.20
5.6.40.0060.02316.10
5.6.30.0070.02916.21
5.6.20.0060.02916.04
5.6.10.0050.02116.24
5.6.00.0050.02016.09
5.5.380.0080.02516.13
5.5.370.0040.02216.19
5.5.360.0050.02416.21
5.5.350.0030.03516.16
5.5.340.0070.01916.27
5.5.330.0040.03416.21
5.5.320.0070.02416.24
5.5.310.0100.02716.28
5.5.300.0080.03216.16
5.5.290.0090.02016.33
5.5.280.0040.01916.42
5.5.270.0060.02316.38
5.5.260.0030.03716.35
5.5.250.0070.03316.18
5.5.240.0070.03115.88
5.5.230.0020.03516.04
5.5.220.0080.03015.95
5.5.210.0080.02816.11
5.5.200.0010.03116.10
5.5.190.0090.02916.03
5.5.180.0100.01815.97
5.5.170.0100.00313.84
5.5.160.0090.02715.94
5.5.150.0100.02916.10
5.5.140.0050.03416.03
5.5.130.0060.02116.04
5.5.120.0040.02916.14
5.5.110.0070.02816.20
5.5.100.0080.02716.01
5.5.90.0070.01815.88
5.5.80.0050.03015.91
5.5.70.0070.02515.99
5.5.60.0120.01515.98
5.5.50.0080.02415.91
5.5.40.0050.02416.07
5.5.30.0080.01816.11
5.5.20.0050.01715.92
5.5.10.0050.01916.01
5.5.00.0030.02016.11
5.4.450.0010.02214.98
5.4.440.0140.02315.00
5.4.430.0030.02114.98
5.4.420.0040.01914.98
5.4.410.0080.02414.95
5.4.400.0030.02914.84
5.4.390.0010.02114.94
5.4.380.0030.01814.91
5.4.370.0070.02814.90
5.4.360.0030.03014.82
5.4.350.0020.03314.88
5.4.340.0100.02414.87
5.4.330.0070.00312.79
5.4.320.0040.02214.89
5.4.310.0070.02914.91
5.4.300.0060.03014.88
5.4.290.0040.02714.81
5.4.280.0050.02814.84
5.4.270.0060.03014.85
5.4.260.0060.02314.90
5.4.250.0080.02114.80
5.4.240.0030.01714.90
5.4.230.0080.01914.93
5.4.220.0070.02814.93
5.4.210.0080.03014.85
5.4.200.0060.02014.87
5.4.190.0070.01414.84
5.4.180.0020.01714.87
5.4.170.0080.02414.82
5.4.160.0090.02214.81
5.4.150.0020.02814.87
5.4.140.0020.01913.97
5.4.130.0050.02513.94
5.4.120.0050.02613.96
5.4.110.0080.02413.93
5.4.100.0030.02813.94
5.4.90.0060.03013.93
5.4.80.0060.02414.00
5.4.70.0050.02813.99
5.4.60.0040.03113.94
5.4.50.0080.02313.94
5.4.40.0040.02913.99
5.4.30.0040.02813.93
5.4.20.0030.03013.96
5.4.10.0040.03013.94
5.4.00.0050.01713.78

preferences:
49.05 ms | 401 KiB | 5 Q