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.60.0110.00416.63
8.3.50.0120.00721.08
8.3.40.0090.00618.79
8.3.30.0070.00718.84
8.3.20.0050.00320.41
8.3.10.0050.00223.69
8.3.00.0060.00319.69
8.2.180.0040.01118.29
8.2.170.0070.00722.96
8.2.160.0060.00920.37
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0060.00317.50
8.2.110.0090.00020.43
8.2.100.0040.00717.78
8.2.90.0030.00519.22
8.2.80.0000.00917.97
8.2.70.0050.00317.63
8.2.60.0050.00517.80
8.2.50.0080.00018.07
8.2.40.0040.00419.38
8.2.30.0000.00820.54
8.2.20.0050.00217.77
8.2.10.0040.00418.05
8.2.00.0040.00417.93
8.1.280.0040.01125.92
8.1.270.0110.00424.02
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0100.00023.86
8.1.230.0050.00520.97
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.13
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0040.00418.46
8.1.160.0050.00321.95
8.1.150.0070.00018.80
8.1.140.0040.00417.34
8.1.130.0040.00417.67
8.1.120.0040.00417.29
8.1.110.0040.00417.37
8.1.100.0000.00717.34
8.1.90.0040.00417.39
8.1.80.0070.00017.34
8.1.70.0030.00317.33
8.1.60.0040.00417.45
8.1.50.0050.00317.52
8.1.40.0060.00317.46
8.1.30.0030.00617.55
8.1.20.0030.00517.55
8.1.10.0030.00617.56
8.1.00.0040.00417.49
8.0.300.0050.00218.77
8.0.290.0040.00416.63
8.0.280.0040.00418.41
8.0.270.0000.00817.27
8.0.260.0060.00317.13
8.0.250.0040.00417.02
8.0.240.0040.00417.02
8.0.230.0070.00016.89
8.0.220.0040.00416.82
8.0.210.0040.00416.84
8.0.200.0040.00416.99
8.0.190.0000.00817.02
8.0.180.0040.00416.92
8.0.170.0040.00416.92
8.0.160.0040.00417.05
8.0.150.0030.00316.90
8.0.140.0000.00716.78
8.0.130.0030.00313.39
8.0.120.0000.00816.72
8.0.110.0050.00216.93
8.0.100.0000.00716.96
8.0.90.0080.00016.76
8.0.80.0070.01016.81
8.0.70.0040.00416.87
8.0.60.0060.00316.96
8.0.50.0080.00016.94
8.0.30.0080.01117.04
8.0.20.0100.00817.40
8.0.10.0040.00416.87
8.0.00.0120.00716.71
7.4.330.0030.00315.08
7.4.320.0000.00616.55
7.4.300.0030.00316.57
7.4.290.0060.00616.42
7.4.280.0160.00016.46
7.4.270.0070.00016.53
7.4.260.0000.00816.45
7.4.250.0030.00516.52
7.4.240.0050.00216.57
7.4.230.0030.00316.40
7.4.220.0070.01016.49
7.4.210.0110.00416.55
7.4.200.0030.00516.36
7.4.160.0090.00616.59
7.4.150.0070.01017.40
7.4.140.0090.01217.86
7.4.130.0060.01116.49
7.4.120.0120.00616.49
7.4.110.0070.00916.58
7.4.100.0090.00916.53
7.4.90.0000.01816.26
7.4.80.0120.00919.39
7.4.70.0000.01716.39
7.4.60.0060.00916.39
7.4.50.0000.00816.50
7.4.40.0100.00716.64
7.4.30.0110.01116.46
7.4.10.0120.00514.93
7.4.00.0090.00814.78
7.3.330.0000.00613.02
7.3.320.0050.00013.20
7.3.310.0070.00016.16
7.3.300.0000.00716.24
7.3.290.0150.00516.23
7.3.280.0090.01116.32
7.3.270.0060.01117.40
7.3.260.0100.00616.38
7.3.250.0120.00716.23
7.3.240.0170.00416.15
7.3.230.0040.01316.43
7.3.210.0030.01316.64
7.3.200.0100.01016.34
7.3.190.0120.00616.38
7.3.180.0030.01316.62
7.3.170.0180.00416.41
7.3.160.0060.01116.26
7.3.130.0070.00714.88
7.3.120.0090.00514.83
7.3.110.0040.01314.98
7.3.100.0090.00614.84
7.3.90.0060.00714.89
7.3.80.0030.01014.60
7.3.70.0030.01014.61
7.3.60.0030.00914.82
7.3.50.0090.00014.67
7.3.40.0080.00814.68
7.3.30.0060.00614.74
7.3.20.0060.00616.55
7.3.10.0050.00816.55
7.3.00.0050.00916.57
7.2.330.0120.00616.48
7.2.320.0180.00316.51
7.2.310.0170.01016.55
7.2.300.0090.00616.53
7.2.290.0110.00616.59
7.2.260.0150.00314.51
7.2.250.0110.00714.84
7.2.240.0030.01514.98
7.2.230.0060.00914.76
7.2.220.0030.01314.81
7.2.210.0080.01015.08
7.2.200.0060.00714.81
7.2.190.0030.01014.66
7.2.180.0050.00814.83
7.2.170.0070.00815.04
7.2.160.0030.00614.98
7.2.150.0100.00016.83
7.2.140.0080.00416.74
7.2.130.0030.01316.84
7.2.120.0030.01216.75
7.2.110.0100.00716.65
7.2.100.0030.00616.80
7.2.90.0030.01316.83
7.2.80.0080.00816.83
7.2.70.0030.01016.91
7.2.60.0090.00616.42
7.2.50.0030.00616.63
7.2.40.0030.01316.84
7.2.30.0100.00316.55
7.2.20.0090.00616.77
7.2.10.0090.00616.85
7.2.00.0080.00818.06
7.1.330.0040.01115.46
7.1.320.0020.01015.74
7.1.310.0060.00815.57
7.1.300.0030.01015.60
7.1.290.0040.00915.54
7.1.280.0090.00515.47
7.1.270.0110.00615.37
7.1.260.0040.00715.65
7.1.250.0090.00615.68
7.1.240.0040.00815.82
7.1.230.0030.01015.75
7.1.220.0060.00615.75
7.1.210.0030.01015.68
7.1.200.0030.01015.42
7.1.190.0060.00615.64
7.1.180.0030.00915.62
7.1.170.0140.00315.61
7.1.160.0100.00615.42
7.1.150.0090.00615.43
7.1.140.0070.01315.57
7.1.130.0040.01115.50
7.1.120.0030.00815.44
7.1.110.0030.01015.64
7.1.100.0070.00416.82
7.1.90.0090.00615.32
7.1.80.0000.01015.60
7.1.70.0050.00616.32
7.1.60.0060.01217.44
7.1.50.0110.01324.98
7.1.40.0030.00715.59
7.1.30.0000.01315.70
7.1.20.0060.00915.69
7.1.10.0040.01115.38
7.1.00.0050.04018.95
7.0.330.0000.01115.24
7.0.320.0030.00615.32
7.0.310.0040.00815.40
7.0.300.0060.00615.20
7.0.290.0080.00015.04
7.0.280.0000.01115.29
7.0.270.0060.00915.23
7.0.260.0080.00615.17
7.0.250.0090.00615.53
7.0.240.0030.01515.34
7.0.230.0070.00715.24
7.0.220.0100.00315.09
7.0.210.0030.01015.35
7.0.200.0010.00816.07
7.0.190.0050.00315.16
7.0.180.0000.01215.31
7.0.170.0000.00815.45
7.0.160.0090.00015.41
7.0.150.0000.00915.23
7.0.140.0030.01015.12
7.0.130.0070.00715.43
7.0.120.0000.00815.16
7.0.110.0000.01115.41
7.0.100.0040.01114.98
7.0.90.0460.03817.48
7.0.80.0280.04617.53
7.0.70.0170.02417.65
7.0.60.0190.04217.63
7.0.50.0270.03317.92
7.0.40.0080.03516.68
7.0.30.0080.02416.67
7.0.20.0070.05116.69
7.0.10.0050.02516.72
7.0.00.0050.04616.71
5.6.400.0060.01014.45
5.6.390.0110.00414.24
5.6.380.0100.00313.95
5.6.370.0090.00614.31
5.6.360.0040.00814.21
5.6.350.0000.01214.07
5.6.340.0090.00614.32
5.6.330.0060.00914.41
5.6.320.0000.01514.29
5.6.310.0040.00414.37
5.6.300.0030.00614.21
5.6.290.0080.00514.25
5.6.280.0050.03117.48
5.6.270.0000.01214.21
5.6.260.0000.01014.14
5.6.250.0060.00914.24
5.6.240.0050.04517.45
5.6.230.0070.03717.44
5.6.220.0020.04317.28
5.6.210.0050.02717.31
5.6.200.0080.04117.64
5.6.190.0070.03517.69
5.6.180.0040.03017.54
5.6.170.0050.04717.64
5.6.160.0050.03417.48
5.6.150.0060.04617.46
5.6.140.0080.03217.47
5.6.130.0060.02517.72
5.6.120.0030.02717.57
5.6.110.0020.03017.60
5.6.100.0080.02317.59
5.6.90.0070.04517.57
5.6.80.0070.03017.32
5.6.70.0050.02417.08
5.6.60.0040.02617.03
5.6.50.0050.02217.33
5.6.40.0060.02217.10
5.6.30.0050.02317.33
5.6.20.0090.02317.18
5.6.10.0020.02617.25
5.6.00.0080.02517.21
5.5.380.0030.04617.27
5.5.370.0020.02817.19
5.5.360.0080.02317.09
5.5.350.0000.03017.16
5.5.340.0080.04017.34
5.5.330.0040.03117.38
5.5.320.0060.03317.43
5.5.310.0030.04017.44
5.5.300.0020.02917.49
5.5.290.0160.01817.50
5.5.280.0140.01717.52
5.5.270.0050.02217.30
5.5.260.0030.02717.44
5.5.250.0030.02517.41
5.5.240.0120.02617.14
5.5.230.0050.02217.13
5.5.220.0130.02817.07
5.5.210.0030.02717.24
5.5.200.0030.02317.13
5.5.190.0030.02417.17
5.5.180.0050.03617.08
5.5.170.0060.00914.00
5.5.160.0030.02517.06
5.5.150.0050.02217.13
5.5.140.0050.01917.12
5.5.130.0120.03017.21
5.5.120.0070.02317.03
5.5.110.0070.02117.15
5.5.100.0080.01817.13
5.5.90.0080.01817.09
5.5.80.0050.02417.11
5.5.70.0030.03116.95
5.5.60.0030.03317.15
5.5.50.0060.02217.01
5.5.40.0030.02416.85
5.5.30.0050.02017.01
5.5.20.0020.02816.89
5.5.10.0040.02617.10
5.5.00.0060.02816.84
5.4.450.0050.02315.74
5.4.440.0030.03715.87
5.4.430.0070.02115.92
5.4.420.0060.02115.89
5.4.410.0030.02315.82
5.4.400.0060.01715.72
5.4.390.0020.02515.74
5.4.380.0050.02015.71
5.4.370.0060.02015.64
5.4.360.0000.02515.75
5.4.350.0060.01815.58
5.4.340.0040.02015.73
5.4.330.0050.00312.38
5.4.320.0030.02015.67
5.4.310.0080.01715.76
5.4.300.0070.01815.67
5.4.290.0030.02515.70
5.4.280.0030.02515.59
5.4.270.0010.02315.72
5.4.260.0070.03015.76
5.4.250.0000.02415.58
5.4.240.0050.02115.71
5.4.230.0020.02315.70
5.4.220.0020.02315.75
5.4.210.0070.01615.73
5.4.200.0060.02315.68
5.4.190.0050.02315.65
5.4.180.0020.02315.74
5.4.170.0050.02015.66
5.4.160.0020.02515.66
5.4.150.0050.04315.58
5.4.140.0050.03314.35
5.4.130.0070.03614.30
5.4.120.0070.03214.31
5.4.110.0030.04014.40
5.4.100.0050.03614.32
5.4.90.0050.03914.36
5.4.80.0020.04314.28
5.4.70.0060.04014.35
5.4.60.0050.03114.28
5.4.50.0060.04014.33
5.4.40.0030.03014.42
5.4.30.0080.03214.28
5.4.20.0030.03514.35
5.4.10.0030.04214.40
5.4.00.0100.03014.08

preferences:
65.11 ms | 401 KiB | 5 Q