3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['user_id'] = 3; $query[] = "select * from preferences user_id = "; $query[] = $_GET['user_id']; db_exec($query); function db_exec(string|array $query_parts) { if (is_string($query_parts) && !is_literal($query_parts)) { throw new \Exception("Cannot use non literal string as query. Please pass the parts in as an array"); } else { foreach ($query_parts as $query_part) { if (is_string($query_part) && !is_literal($query_part)) { throw new \Exception("non-literal string found [$query_part]"); } else if (is_int($query_part)) { // todo - decide if you want to allow this or not. // I personally wouldn't. } else { // todo - support other types } } var_dump(implode("", $query_parts)); } // rest of db_exec here... }

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.0090.00916.88
8.3.50.0060.00918.23
8.3.40.0160.00018.93
8.3.30.0090.00618.88
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0070.00026.16
8.2.180.0130.00325.92
8.2.170.0090.00618.80
8.2.160.0100.01022.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0040.00422.29
8.2.100.0040.00818.03
8.2.90.0030.00617.75
8.2.80.0080.00018.91
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0050.00318.07
8.2.40.0080.00018.20
8.2.30.0040.00418.21
8.2.20.0030.00718.05
8.2.10.0040.00421.08
8.2.00.0080.00019.28
8.1.270.0070.00323.82
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0090.00019.21
8.1.230.0110.00017.89
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00017.23
8.1.190.0080.00017.13
8.1.180.0060.00318.10
8.1.170.0050.00318.84
8.1.160.0080.00018.92
8.1.150.0070.00018.82
8.1.140.0040.00418.95
8.1.130.0070.00020.20
8.1.120.0030.00517.45
8.1.110.0060.00317.49
8.1.100.0030.00617.37
8.1.90.0070.00017.50
8.1.80.0080.00317.40
8.1.70.0080.00017.31
8.1.60.0040.00417.49
8.1.50.0040.00417.45
8.1.40.0040.00417.54
8.1.30.0080.00017.52
8.1.20.0000.00917.57
8.1.10.0000.00817.49
8.1.00.0040.00417.58
8.0.300.0080.00020.16
8.0.290.0000.00816.88
8.0.280.0050.00218.43
8.0.270.0070.00018.08
8.0.260.0030.00318.57
8.0.250.0040.00417.05
8.0.240.0030.00317.03
8.0.230.0020.00517.00
8.0.220.0030.00316.89
8.0.210.0030.00316.96
8.0.200.0040.00417.02
8.0.190.0000.00716.97
8.0.180.0050.00216.93
8.0.170.0030.00516.89
8.0.160.0080.00017.06
8.0.150.0000.00716.87
8.0.140.0030.00516.92
8.0.130.0060.00013.49
8.0.120.0050.00317.00
8.0.110.0050.00217.05
8.0.100.0040.00417.00
8.0.90.0000.00716.99
8.0.80.0120.00916.94
8.0.70.0120.00916.90
8.0.60.0060.01616.86
8.0.50.0060.01716.96
8.0.30.0040.01116.88
8.0.20.0150.00717.00
8.0.10.0150.00617.10
8.0.00.0120.00917.16
7.4.330.0020.00215.55
7.4.320.0000.00616.43
7.4.300.0030.00316.37
7.4.290.0040.00716.17
7.4.280.0030.00516.35
7.4.270.0030.00316.45
7.4.260.0060.00013.11
7.4.250.0030.00316.33
7.4.240.0020.00516.34
7.4.230.0070.00016.24
7.4.220.0070.00016.17
7.4.210.0070.01316.41
7.4.200.0140.00616.41
7.4.190.0140.00716.38
7.4.180.0090.01216.40
7.4.160.0100.01016.31
7.4.150.0100.00616.24
7.4.140.0140.00716.28
7.4.130.0170.00316.11
7.4.120.0080.00816.11
7.4.110.0070.01016.40
7.4.100.0060.01316.32
7.4.90.0060.01216.06
7.4.80.0070.01116.23
7.4.70.0120.00916.11
7.4.60.0060.01316.29
7.4.50.0070.01416.21
7.4.40.0000.01816.33
7.4.30.0130.00316.19
7.4.20.0030.01216.20
7.4.10.0090.01016.22
7.4.00.0060.01316.30
7.3.330.0040.00316.13
7.3.320.0030.00312.98
7.3.310.0040.00416.01
7.3.300.0050.00216.11
7.3.290.0080.01116.09
7.3.280.0000.01516.18
7.3.270.0110.00416.31
7.3.260.0130.00616.22
7.3.250.0170.00316.16
7.3.240.0070.01316.20
7.3.230.0100.01016.14
7.3.220.0130.00316.09
7.3.210.0200.00016.15
7.3.200.0070.01116.06
7.3.190.0060.01316.08
7.3.180.0130.00716.10
7.3.170.0110.00716.02
7.3.160.0090.00916.03
7.3.150.0090.00916.03
7.3.140.0100.00616.02
7.3.130.0120.00316.07
7.3.120.0160.00316.16
7.3.110.0100.00715.98
7.3.100.0130.00615.97
7.3.90.0100.01016.40
7.3.80.0100.00916.16
7.3.70.0060.01416.11
7.3.60.0100.01016.20
7.3.50.0070.00716.11
7.3.40.0070.01316.21
7.3.30.0090.00616.14
7.3.20.0060.01018.12
7.3.10.0070.01117.88
7.3.00.0030.01318.07

preferences:
63.76 ms | 400 KiB | 5 Q