3v4l.org

run code in 500+ PHP versions simultaneously
<?php function tableName () { return 'table_name'; } function select (array $columns, array $where) { for ($i = 0; $i < count($where); $i++){ $conditions[] = $where[$i][0] . ' ' . $where[$i][1] . ' :' . $where[$i][0]; $params[] = $where[$i][2]; } $sql = implode(" AND ", array_map(fn($cond) => "$cond", $conditions)); $columns = implode(", ",array_map(fn($att) => "$att",$columns)); echo "SELECT $columns FROM ".tableName()." WHERE $sql"; } $arrayCol = ["username","email"]; $arrayWhere = [["id", ">", 3], ["firstname", "=", "John"]]; select($arrayCol,$arrayWhere); ?>

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.5.70.0120.00516.91
8.5.60.0140.00417.00
8.5.50.0130.00516.88
8.5.30.0100.00719.97
8.5.20.0090.01020.23
8.5.10.0110.00618.80
8.5.00.0140.00819.94
8.4.210.0050.00419.53
8.4.180.0120.01021.95
8.4.170.0150.00920.53
8.4.160.0160.00923.77
8.4.150.0070.00516.89
8.4.140.0100.01117.65
8.4.130.0110.00819.01
8.4.120.0110.00524.04
8.4.110.0120.00718.93
8.4.100.0130.00718.73
8.4.90.0100.00818.61
8.4.80.0150.00617.68
8.4.70.0130.00817.83
8.4.60.0080.00917.99
8.4.50.0140.00622.26
8.4.40.0160.00319.32
8.4.30.0110.00820.41
8.4.20.0100.01017.86
8.4.10.0150.00419.48
8.3.300.0130.00720.95
8.3.290.0060.00720.82
8.3.280.0150.00918.48
8.3.270.0130.00816.36
8.3.260.0050.00316.52
8.3.250.0120.00919.01
8.3.240.0090.00917.36
8.3.230.0140.00916.54
8.3.220.0080.01216.61
8.3.210.0110.00416.78
8.3.200.0090.00916.57
8.3.190.0110.00618.20
8.3.180.0020.00618.40
8.3.170.0070.00018.84
8.3.160.0150.00419.09
8.3.150.0160.00318.53
8.3.140.0000.00817.25
8.3.130.0080.00018.58
8.3.120.0040.00420.59
8.3.110.0080.00820.94
8.3.100.0040.01224.06
8.3.90.0030.00526.77
8.3.80.0060.00316.63
8.3.70.0120.00316.75
8.3.60.0160.00616.75
8.3.50.0040.01120.03
8.3.40.0170.00319.38
8.3.30.0110.00418.99
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.300.0090.01022.20
8.2.290.0100.00720.67
8.2.280.0110.00818.54
8.2.270.0060.01318.84
8.2.260.0040.01116.60
8.2.250.0080.00018.93
8.2.240.0110.00717.08
8.2.230.0040.00422.58
8.2.220.0090.00037.54
8.2.210.0070.00726.77
8.2.200.0060.00316.88
8.2.190.0130.01016.58
8.2.180.0060.00925.92
8.2.170.0070.00718.94
8.2.160.0110.00322.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0120.00621.11
8.2.100.0060.00617.84
8.2.90.0000.00818.32
8.2.80.0000.00819.89
8.2.70.0070.00417.63
8.2.60.0040.00417.50
8.2.50.0040.00418.07
8.2.40.0000.00818.20
8.2.30.0080.00018.04
8.2.20.0040.00420.31
8.2.10.0080.00017.82
8.2.00.0050.00319.35
8.1.340.0100.01019.89
8.1.330.0090.01022.13
8.1.320.0120.00716.26
8.1.310.0090.00918.46
8.1.300.0040.00419.62
8.1.290.0110.00018.88
8.1.280.0130.00725.92
8.1.270.0140.00722.14
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.63
8.1.230.0110.00021.00
8.1.220.0030.00517.79
8.1.210.0080.00018.79
8.1.200.0000.00817.35
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0030.00618.75
8.1.160.0040.00418.97
8.1.150.0000.00718.64
8.1.140.0040.00417.51
8.1.130.0030.00317.38
8.1.120.0040.00417.50
8.1.110.0070.00017.37
8.1.100.0040.00417.36
8.1.90.0090.00017.46
8.1.80.0050.00317.48
8.1.70.0000.00717.45
8.1.60.0000.00817.52
8.1.50.0030.00617.55
8.1.40.0050.00317.52
8.1.30.0150.00617.64
8.1.20.0150.00917.60
8.1.10.0210.00317.51
8.1.00.0180.00817.43
8.0.300.0050.00320.04
8.0.290.0070.00016.75
8.0.280.0030.00318.33
8.0.270.0030.00316.70
8.0.260.0030.00320.20
8.0.250.0030.00517.02
8.0.240.0070.00016.89
8.0.230.0030.00716.86
8.0.220.0070.00016.84
8.0.210.0030.00316.92
8.0.200.0000.00717.02
8.0.190.0050.00316.96
8.0.180.0080.00016.96
8.0.170.0030.00616.95
8.0.160.0100.00616.84
8.0.150.0150.00616.79
8.0.140.0180.00316.82
8.0.130.0180.00216.79
8.0.120.0170.00216.90
8.0.110.0170.00116.83
8.0.100.0140.00516.79
8.0.90.0160.00416.84
8.0.80.0130.00616.85
8.0.70.0130.00616.80
8.0.60.0140.00516.82
8.0.50.0150.00416.78
8.0.30.0140.00516.84
8.0.20.0170.00316.95
8.0.10.0130.00716.95
7.4.330.0000.00515.55
7.4.320.0000.00616.62
7.4.300.0000.00616.50
7.4.290.0040.00416.38
7.4.280.0180.00416.54
7.4.270.0160.00616.52
7.4.260.0170.00516.54
7.4.250.0110.00716.49
7.4.240.0130.00516.52
7.4.230.0130.00416.56
7.4.220.0140.00116.57
7.4.210.0140.00316.51
7.4.200.0160.00216.49
7.4.190.0190.00116.55
7.4.180.0150.00316.67
7.4.160.0150.00316.50
7.4.150.0110.00816.53
7.4.140.0150.00416.55
7.4.130.0150.00516.48
7.4.120.0140.00616.47
7.4.110.0160.00316.50
7.4.100.0130.00616.46
7.4.90.0170.00316.45
7.4.80.0150.00416.44
7.4.70.0120.00616.49
7.4.60.0130.00616.42
7.4.50.0160.00516.31
7.4.40.0150.00216.30
7.4.30.0110.00616.51
7.4.20.0150.00416.40
7.4.10.0140.00416.44
7.4.00.0110.00616.48

preferences:
56.02 ms | 1262 KiB | 5 Q