3v4l.org

run code in 300+ PHP versions simultaneously
<?php function escape(string $query) { return preg_replace_callback('/{(([^.}]+?)\.)?(.*?)}/', function ($matches) { $quoted = ''; // Quote table name. If there is an explicit database, quote it, too. if ($matches[2] !== '') { $quoted .= '`' . $matches[2] . '`.'; } // Quote the table name, keeping curly brackets so potential prefixes can // be added later. $quoted .= '`{' . $matches[3] . '}`'; return $quoted; }, $query); } var_dump(escape('SELECT * FROM system')); var_dump(escape('SELECT * FROM {system} ')); var_dump(escape('SELECT * FROM {db.system}')); var_dump(escape('SELECT * FROM db.system'));

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.4.140.0160.00717.81
8.4.130.0110.01117.98
8.4.120.0130.00920.91
8.4.110.0070.00822.41
8.4.100.0130.00818.13
8.4.90.0060.00418.82
8.4.80.0090.00718.03
8.4.70.0080.00518.24
8.4.60.0120.00920.79
8.4.50.0100.01119.50
8.4.40.0030.00517.58
8.4.30.0150.00420.75
8.4.20.0110.01119.90
8.4.10.0060.00322.42
8.3.270.0090.01018.42
8.3.260.0120.00916.58
8.3.250.0160.00618.84
8.3.240.0130.00716.75
8.3.230.0120.00716.65
8.3.220.0040.00417.19
8.3.210.0100.00416.81
8.3.200.0050.00416.63
8.3.190.0110.00617.46
8.3.180.0110.00516.65
8.3.170.0150.00418.82
8.3.160.0120.00618.48
8.3.150.0130.00620.79
8.3.140.0040.00417.04
8.3.130.0030.00518.74
8.3.120.0040.01120.72
8.3.110.0040.00416.87
8.3.100.0060.00324.06
8.3.90.0060.00326.77
8.3.80.0030.00616.88
8.3.70.0110.01116.75
8.3.60.0140.00718.55
8.3.50.0150.00624.59
8.3.40.0070.00719.09
8.3.30.0060.00918.84
8.3.20.0070.00424.18
8.3.10.0050.00324.66
8.3.00.0000.00826.16
8.2.290.0060.00420.50
8.2.280.0050.00318.46
8.2.270.0110.00717.38
8.2.260.0180.00018.87
8.2.250.0080.00016.85
8.2.240.0030.00617.26
8.2.230.0070.00320.94
8.2.220.0080.00037.54
8.2.210.0050.00326.77
8.2.200.0060.00316.88
8.2.190.0150.00716.88
8.2.180.0060.01225.92
8.2.170.0070.00719.25
8.2.160.0100.00322.96
8.2.150.0000.00725.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.01
8.2.110.0000.00920.39
8.2.100.0110.00018.34
8.2.90.0030.00519.22
8.2.80.0080.00017.97
8.2.70.0000.00917.88
8.2.60.0040.00418.16
8.2.50.0030.00618.07
8.2.40.0080.00018.28
8.2.30.0000.00818.21
8.2.20.0000.00718.25
8.2.10.0040.00419.40
8.2.00.0000.00719.29
8.1.330.0090.01021.98
8.1.320.0110.00817.96
8.1.310.0090.00016.75
8.1.300.0100.00016.35
8.1.290.0060.00318.88
8.1.280.0000.01525.92
8.1.270.0030.00523.99
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0060.00322.07
8.1.230.0000.01217.64
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0030.00617.60
8.1.190.0050.00317.48
8.1.180.0000.00818.10
8.1.170.0080.00318.64
8.1.160.0060.00318.98
8.1.150.0040.00418.90
8.1.140.0040.00419.02
8.1.130.0000.00717.54
8.1.120.0020.00517.68
8.1.110.0050.00317.61
8.1.100.0050.00217.62
8.1.90.0040.00417.67
8.1.80.0030.00617.61
8.1.70.0020.00517.51
8.1.60.0000.00817.68
8.1.50.0030.00517.59
8.1.40.0030.00517.72
8.1.30.0000.00817.84
8.1.20.0040.00417.72
8.1.10.0080.00017.76
8.1.00.0030.00617.73
8.0.300.0000.00818.77
8.0.290.0060.00317.00
8.0.280.0000.00718.40
8.0.270.0050.00218.04
8.0.260.0000.00717.00
8.0.250.0070.00017.12
8.0.240.0000.00817.06
8.0.230.0050.00217.17
8.0.220.0000.00717.04
8.0.210.0070.00017.02
8.0.200.0000.00817.16
8.0.190.0040.00417.05
8.0.180.0040.00417.14
8.0.170.0050.00517.00
8.0.160.0040.00416.98
8.0.150.0040.00417.03
8.0.140.0040.00817.04
8.0.130.0030.00313.51
8.0.120.0050.00317.04
8.0.110.0040.00417.02
8.0.100.0000.00817.16
8.0.90.0050.00316.95
8.0.80.0070.00917.07
8.0.70.0020.00516.92
8.0.60.0050.00216.95
8.0.50.0000.00817.16
8.0.30.0060.01217.43
8.0.20.0080.01017.38
8.0.10.0000.00717.17
8.0.00.0120.00617.25
7.4.330.0030.00315.55
7.4.320.0050.00216.82
7.4.300.0000.00716.67
7.4.290.0070.00016.75
7.4.280.0000.00816.84
7.4.270.0030.00316.82
7.4.260.0060.00013.52
7.4.250.0030.00316.85
7.4.240.0030.00316.89
7.4.230.0000.00716.84
7.4.220.0000.00716.83
7.4.210.0050.00916.80
7.4.200.0070.00016.68
7.4.130.0080.01116.76
7.4.120.0060.01816.77
7.4.110.0090.00916.78
7.4.100.0100.00716.74
7.4.90.0130.00616.79
7.4.80.0140.00919.39
7.4.70.0160.01216.62
7.4.60.0220.00816.71
7.4.50.0200.01016.55
7.4.40.0240.01016.47
7.4.30.0210.00616.26
7.4.20.0240.00516.87
7.4.10.0280.00316.74
7.4.00.0050.01316.62
7.3.330.0060.00316.32
7.3.320.0030.00313.23
7.3.310.0000.00716.32
7.3.300.0030.00316.33
7.3.290.0070.00816.44
7.3.280.0040.01116.42
7.3.260.0170.00816.61
7.3.240.0110.00816.51
7.3.230.0140.00916.80
7.3.210.0100.01016.51
7.3.200.0110.00919.39
7.3.190.0220.00916.31
7.3.180.0240.01316.37
7.3.170.0220.00916.55
7.3.160.0150.01616.61
7.3.150.0310.00416.43
7.3.140.0250.00716.64
7.3.130.0290.00316.63
7.3.120.0220.00816.34
7.3.110.0220.01316.36
7.3.100.0310.01116.37
7.3.90.0270.00416.38
7.3.80.0300.01016.63
7.3.70.0220.00916.54
7.3.60.0240.00816.34
7.3.50.0170.01416.48
7.3.40.0170.01416.51
7.3.30.0170.01216.44
7.3.20.0240.00718.35
7.3.10.0170.00618.20
7.3.00.0200.00018.03
7.2.330.0110.00716.77
7.2.310.0250.00716.71
7.2.300.0180.01516.94
7.2.290.0130.01716.66
7.2.280.0240.00916.86
7.2.270.0160.01616.62
7.2.260.0150.01916.86
7.2.250.0150.01516.55
7.2.240.0220.01016.76
7.2.230.0200.02016.64
7.2.220.0290.01116.77
7.2.210.0200.01716.63
7.2.200.0310.00516.65
7.2.190.0240.00916.69
7.2.180.0230.01016.92
7.2.170.0110.01916.73
7.2.160.0220.01016.84
7.2.150.0260.00718.61
7.2.140.0130.00718.70
7.2.130.0090.01418.48
7.2.120.0230.00318.54
7.2.110.0160.00718.50
7.2.100.0180.00618.54
7.2.90.0190.01518.52
7.2.80.0100.01618.55
7.2.70.0200.00318.56
7.2.60.0130.01118.52
7.2.50.0290.00616.71
7.2.40.0260.00018.47
7.2.30.0260.00418.66
7.2.20.0080.01618.48
7.2.10.0160.00818.46
7.2.00.0090.00918.41

preferences:
138.16 ms | 403 KiB | 5 Q