3v4l.org

run code in 300+ PHP versions simultaneously
<?php include_once 'dbconfig.php'; $method = $_SERVER['REQUEST_METHOD']; switch($method) { case 'POST': $data = json_decode($_POST['params']); $name = $data['name']; $sql_query = "INSERT INTO person(name) VALUES('$name')"; $result = mysqli_query($link, $sql_query); break; case 'GET': $uriParts = spliti ("/", $_SERVER['REQUEST_URI']); $id = end($uriParts); $sql_query="SELECT * FROM person WHERE id=".$id; $result_set=mysqli_query($link, $sql_query); $rows = array(); while($r = mysqli_fetch_assoc($result_set)) { $rows[] = $r; } break; } header('Content-type: application/json'); echo json_encode($rows);

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.0140.00318.55
8.3.60.0060.01218.31
8.3.50.0030.01821.20
8.3.40.0130.00318.96
8.3.30.0070.00718.83
8.3.20.0040.00419.33
8.3.10.0070.00021.73
8.3.00.0050.00319.10
8.2.190.0070.01416.75
8.2.180.0160.00318.79
8.2.170.0090.00622.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00420.78
8.2.120.0040.00426.35
8.2.110.0000.01020.38
8.2.100.0060.00617.91
8.2.90.0060.00318.34
8.2.80.0040.00417.97
8.2.70.0000.00817.93
8.2.60.0000.00818.22
8.2.50.0000.00818.10
8.2.40.0020.00520.46
8.2.30.0040.00419.21
8.2.20.0070.00018.21
8.2.10.0000.00718.00
8.2.00.0050.00317.81
8.1.280.0040.01125.92
8.1.270.0070.00723.99
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0090.01322.08
8.1.230.0030.00823.88
8.1.220.0030.00517.78
8.1.210.0000.00818.86
8.1.200.0040.00417.35
8.1.190.0090.00317.25
8.1.180.0040.00418.10
8.1.170.0000.00818.78
8.1.160.0070.00018.97
8.1.150.0030.00320.22
8.1.140.0000.00819.64
8.1.130.0030.00317.76
8.1.120.0030.00317.38
8.1.110.0000.00817.47
8.1.100.0030.00517.48
8.1.90.0080.00017.50
8.1.80.0000.00717.45
8.1.70.0000.00817.34
8.1.60.0060.00317.67
8.1.50.0000.00817.62
8.1.40.0030.00617.51
8.1.30.0000.00817.65
8.1.20.0040.00417.78
8.1.10.0030.00517.59
8.1.00.0040.00417.58
8.0.300.0040.00420.11
8.0.290.0050.00316.88
8.0.280.0000.00718.53
8.0.270.0000.00717.38
8.0.260.0000.00617.34
8.0.250.0000.00717.09
8.0.240.0000.00817.13
8.0.230.0040.00417.09
8.0.220.0000.00717.02
8.0.210.0000.00717.06
8.0.200.0000.00616.99
8.0.190.0000.00716.99
8.0.180.0070.00316.93
8.0.170.0000.00817.13
8.0.160.0000.00717.13
8.0.150.0070.00017.02
8.0.140.0030.00716.99
8.0.130.0000.00613.56
8.0.120.0040.00417.00
8.0.110.0040.00417.02
8.0.100.0030.00317.15
8.0.90.0040.00417.00
8.0.80.0000.01617.01
8.0.70.0030.00516.99
8.0.60.0000.00716.96
8.0.50.0040.00417.08
8.0.30.0100.00917.17
8.0.20.0150.00617.40
8.0.10.0030.00616.94
8.0.00.0140.00317.02
7.4.330.0050.00015.55
7.4.320.0060.00016.51
7.4.300.0030.00316.63
7.4.290.0000.00716.63
7.4.280.0080.00016.61
7.4.270.0000.00816.55
7.4.260.0070.00016.59
7.4.250.0040.00416.56
7.4.240.0040.00416.46
7.4.230.0000.00716.60
7.4.220.0090.00916.43
7.4.210.0080.00816.62
7.4.200.0070.00016.73
7.4.160.0110.01116.51
7.4.150.0090.01617.40
7.4.140.0120.00817.86
7.4.130.0150.00716.63
7.4.120.0090.01016.64
7.4.110.0070.01016.49
7.4.100.0150.00516.45
7.4.90.0130.00316.57
7.4.80.0120.00619.39
7.4.70.0090.00916.58
7.4.60.0080.00816.54
7.4.50.0120.00016.71
7.4.40.0110.00516.66
7.4.30.0090.01216.41
7.4.10.0060.01315.25
7.4.00.0100.00714.96
7.3.330.0050.00013.16
7.3.320.0030.00313.23
7.3.310.0000.01016.36
7.3.300.0030.00316.25
7.3.290.0040.01116.44
7.3.280.0090.00916.41
7.3.270.0130.00417.40
7.3.260.0090.01116.54
7.3.250.0110.00616.42
7.3.240.0120.00716.42
7.3.230.0080.00816.53
7.3.210.0060.01216.59
7.3.200.0070.01016.44
7.3.190.0100.00616.46
7.3.180.0000.01716.45
7.3.170.0030.01916.59
7.3.160.0100.01016.51
7.3.130.0140.00414.97
7.3.120.0070.01114.79
7.3.110.0050.01114.92
7.3.100.0090.00614.78
7.3.90.0080.00614.79
7.3.80.0080.00514.96
7.3.70.0030.01114.94
7.3.60.0130.00214.93
7.3.50.0080.00715.01
7.3.40.0030.01014.98
7.3.30.0060.00914.72
7.3.20.0070.00816.78
7.3.10.0050.01216.57
7.3.00.0060.00816.63
7.2.330.0090.01016.84
7.2.320.0030.01316.52
7.2.310.0120.00416.36
7.2.300.0120.01216.53
7.2.290.0070.01016.61
7.2.260.0060.00914.97
7.2.250.0070.01114.94
7.2.240.0040.00914.94
7.2.230.0060.00615.02
7.2.220.0060.00815.06
7.2.210.0040.00815.10
7.2.200.0060.01015.13
7.2.190.0050.01115.11
7.2.180.0070.00714.91
7.2.170.0060.00614.99
7.2.160.0030.00914.88
7.2.150.0040.00816.95
7.2.140.0100.00516.70
7.2.130.0050.01016.77
7.2.120.0060.01016.93
7.2.110.0030.01116.77
7.2.100.0090.00416.81
7.2.90.0050.01016.93
7.2.80.0060.00916.93
7.2.70.0050.00916.84
7.2.60.0100.00616.96
7.2.50.0090.00816.85
7.2.40.0070.00716.83
7.2.30.0050.00716.95
7.2.20.0070.01016.80
7.2.10.0060.00816.85
7.2.00.0040.01016.74
7.1.330.0030.01215.91
7.1.320.0050.01115.76
7.1.310.0070.00715.75
7.1.300.0040.01115.79
7.1.290.0090.00715.90
7.1.280.0050.00716.00
7.1.270.0100.00215.69
7.1.260.0060.00515.79
7.1.250.0070.00715.93
7.1.240.0000.01115.68
7.1.230.0060.00815.50
7.1.220.0050.00915.73
7.1.210.0100.00215.83
7.1.200.0070.00615.75
7.1.190.0030.01015.65
7.1.180.0030.01115.73
7.1.170.0080.00815.76
7.1.160.0030.00715.69
7.1.150.0090.00415.68
7.1.140.0080.00815.92
7.1.130.0060.00815.71
7.1.120.0030.01015.68
7.1.110.0070.00515.91
7.1.100.0030.00815.87
7.1.90.0050.00915.98
7.1.80.0090.00515.87
7.1.70.0030.00616.23
7.1.60.0040.00816.29
7.1.50.0080.00515.86
7.1.40.0050.00515.78
7.1.30.0070.00815.69
7.1.20.0100.00715.90
7.1.10.0050.00515.81
7.1.00.0290.02417.38
7.0.330.0090.00615.37
7.0.320.0070.00515.37
7.0.310.0050.00715.25
7.0.300.0090.00315.18
7.0.290.0020.00915.23
7.0.280.0030.01015.21
7.0.270.0070.00715.16
7.0.260.0030.01115.30
7.0.250.0090.00415.37
7.0.240.0050.00615.37
7.0.230.0060.00615.23
7.0.220.0090.00315.49
7.0.210.0030.01015.31
7.0.200.0080.00415.64
7.0.190.0060.00315.35
7.0.180.0060.00615.39
7.0.170.0020.01315.13
7.0.160.0050.00615.41
7.0.150.0060.00515.33
7.0.140.0040.00915.49
7.0.130.0210.03016.93
7.0.120.0270.03317.11
7.0.110.0210.02917.03
7.0.100.0200.02517.05
7.0.90.0270.02517.04
7.0.80.0300.03117.03
7.0.70.0200.02917.13
7.0.60.0260.03017.06
7.0.50.0260.03517.14
7.0.40.0300.03015.68
7.0.30.0270.03215.73
7.0.20.0320.02915.61
7.0.10.0280.02915.81
7.0.00.0460.03415.60
5.6.400.0000.00814.34
5.6.390.0070.01014.13
5.6.380.0120.00214.58
5.6.370.0060.00814.48
5.6.360.0000.01514.63
5.6.350.0040.00814.51
5.6.340.0050.00914.41
5.6.330.0060.00714.32
5.6.320.0090.00614.44
5.6.310.0080.00514.41
5.6.300.0060.00814.22
5.6.290.0060.00514.49
5.6.280.0120.02416.43
5.6.270.0040.03116.64
5.6.260.0060.03416.41
5.6.250.0100.03016.61
5.6.240.0080.03516.48
5.6.230.0110.03116.45
5.6.220.0120.02316.35
5.6.210.0100.03216.62
5.6.200.0080.02716.40
5.6.190.0040.03016.32
5.6.180.0090.03216.55
5.6.170.0090.02616.47
5.6.160.0020.03216.50
5.6.150.0110.03116.44
5.6.140.0090.02616.49
5.6.130.0050.03216.49
5.6.120.0080.03116.39
5.6.110.0090.02816.72
5.6.100.0110.02916.47
5.6.90.0120.03416.74
5.6.80.0090.02816.36
5.6.70.0080.02116.29
5.6.60.0060.02716.21
5.6.50.0040.02616.40
5.6.40.0060.02616.30
5.6.30.0060.02916.23
5.6.20.0030.03216.19
5.6.10.0080.02616.42
5.6.00.0100.03116.33

preferences:
74.51 ms | 401 KiB | 5 Q