3v4l.org

run code in 300+ PHP versions simultaneously
<?php // // () [] {} <> // // when not using them in the expression itself echo '(123) ', preg_match('(123)', "123"), "\n"; // when using them balanced echo '[[123]] ', preg_match('[[123]]', "1"), "\n"; // when using them unbalanced: <> which is rarely special echo '<1 < 2> ', preg_match('<1 < 2>', "1 < 2"), "\n"; // warning // must be escaped echo '<1 \< 2> ', preg_match('<1 \< 2>', "1 < 2"), "\n\n"; // when using them unbalanced: {} which is almost always special echo '{function [({]} ', preg_match('{function [({]}', "function () {"), "\n"; // warning // must be escaped even when it represents a literal character echo '{function [(\{]} ', preg_match('{function [(\{]}', "function () {"), "\n\n"; // // other plain symbols // echo '!1! ', preg_match('!1!', "1"), "\n"; echo '%1% ', preg_match('%1%', "1"), "\n"; echo '_1_ ', preg_match('_1_', "1"), "\n"; // // other symbols that can be special: # $ ^ * + | . ? // these will break your expression // echo '^^123$^ ', preg_match('^^123$^', "123"), "\n"; // warning echo '^\^123$^ ', preg_match('^\^123$^', "123"), "\n\n"; // no match (would match '^123' at the end of the string) echo '|(foo|bar|baz)| ', preg_match('|(foo|bar|baz)|', "foo"), "\n"; // warning echo '|(foo\|bar\|baz)| ', preg_match('|(foo\|bar\|baz)|', "foo"), "\n\n"; // no match (would match 'foo|bar|baz') // // beware: even - ' can be special // // - for a character set range echo '-[a-zA-Z]- ', preg_match('-[a-zA-Z]-', "m"), "\n"; // warning echo '-[a\-zA\-Z]- ', preg_match('-[a\-zA\-Z]-', "m"), "\n\n"; // no match (would match 'a' '-' 'z' 'A' 'Z') // ' for named subpatterns echo "'(?'alpha'[a-zA-Z])\k'alpha'' ", preg_match("'(?'alpha'[a-zA-Z])\k'alpha''", "mm"), "\n"; // warning about delimiter echo "'(?\'alpha\'[a-zA-Z])\k\'alpha\'' ", preg_match("'(?\'alpha\'[a-zA-Z])\k\'alpha\''", "mm"), "\n\n"; // warning about syntax

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.0070.01418.43
8.3.50.0070.00821.99
8.3.40.0150.00018.92
8.3.30.0090.00619.17
8.3.20.0040.00420.30
8.3.10.0050.00321.80
8.3.00.0040.00417.91
8.2.180.0000.01518.66
8.2.170.0150.00622.96
8.2.160.0100.00320.48
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00420.96
8.2.110.0030.00622.05
8.2.100.0120.00018.22
8.2.90.0080.00019.09
8.2.80.0030.00517.97
8.2.70.0000.00917.86
8.2.60.0090.00017.93
8.2.50.0030.00618.07
8.2.40.0040.00418.22
8.2.30.0040.00418.31
8.2.20.0000.00817.94
8.2.10.0000.00818.19
8.2.00.0050.00317.87
8.1.280.0100.00325.92
8.1.270.0080.00823.87
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.91
8.1.230.0070.00419.34
8.1.220.0000.00817.88
8.1.210.0030.00518.77
8.1.200.0030.00717.48
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0030.00618.90
8.1.160.0070.00022.06
8.1.150.0050.00318.73
8.1.140.0040.00417.61
8.1.130.0000.00717.94
8.1.120.0040.00417.59
8.1.110.0000.00817.54
8.1.100.0000.00817.56
8.1.90.0000.00717.41
8.1.80.0000.00817.42
8.1.70.0070.00017.40
8.1.60.0040.00417.64
8.1.50.0030.00517.62
8.1.40.0000.00817.62
8.1.30.0040.00417.69
8.1.20.0090.00017.70
8.1.10.0000.00817.60
8.1.00.0040.00417.46
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0000.00718.43
8.0.270.0020.00517.26
8.0.260.0000.00717.30
8.0.250.0030.00317.15
8.0.240.0030.00317.08
8.0.230.0000.00717.04
8.0.220.0030.00316.99
8.0.210.0050.00316.99
8.0.200.0000.00717.04
8.0.190.0000.00717.04
8.0.180.0040.00417.00
8.0.170.0050.00216.97
8.0.160.0000.00716.89
8.0.150.0000.00816.92
8.0.140.0070.00016.86
8.0.130.0060.00013.42
8.0.120.0080.00017.05
8.0.110.0000.00717.13
8.0.100.0000.00817.05
8.0.90.0050.00216.90
8.0.80.0100.01417.13
8.0.70.0080.00017.11
8.0.60.0040.00416.91
8.0.50.0020.00517.03
8.0.30.0120.00917.30
8.0.20.0100.01017.40
8.0.10.0070.00017.21
8.0.00.0090.01216.94
7.4.330.0050.00015.07
7.4.320.0070.00016.78
7.4.300.0030.00316.68
7.4.290.0030.00316.68
7.4.280.0060.00316.69
7.4.270.0000.00716.64
7.4.260.0030.00516.80
7.4.250.0000.00716.79
7.4.240.0030.00516.73
7.4.230.0040.00416.49
7.4.220.0030.01416.61
7.4.210.0100.00616.82
7.4.200.0080.00016.54
7.4.160.0080.00816.82
7.4.150.0110.00817.40
7.4.140.0130.00617.86
7.4.130.0100.00916.73
7.4.120.0060.01216.63
7.4.110.0100.00716.61
7.4.100.0090.00916.72
7.4.90.0110.00816.71
7.4.80.0100.01019.39
7.4.70.0120.00616.59
7.4.60.0090.00916.61
7.4.50.0000.00516.73
7.4.40.0140.01116.71
7.4.30.0030.01816.71
7.4.00.0070.00715.08
7.3.330.0000.00513.28
7.3.320.0050.00013.12
7.3.310.0030.00316.43
7.3.300.0000.00716.43
7.3.290.0180.00516.50
7.3.280.0130.00316.41
7.3.270.0180.00017.40
7.3.260.0150.02216.58
7.3.250.0110.00716.54
7.3.240.0090.00916.71
7.3.230.0060.01216.39
7.3.210.0100.00716.43
7.3.200.0070.01419.39
7.3.190.0150.00916.52
7.3.180.0060.01016.44
7.3.170.0100.00716.56
7.3.160.0100.00716.79
7.3.120.0070.00714.69
7.3.110.0100.01014.82
7.3.100.0100.00314.95
7.3.90.0090.00314.95
7.3.80.0130.00314.88
7.3.70.0070.01114.58
7.3.60.0000.01214.85
7.3.50.0030.01215.03
7.3.40.0090.00614.72
7.3.30.0030.01314.95
7.3.20.0030.00916.67
7.3.10.0070.00716.82
7.3.00.0060.01016.64
7.2.330.0160.00016.68
7.2.320.0150.00316.77
7.2.310.0040.01516.73
7.2.300.0120.01216.71
7.2.290.0070.01016.61
7.2.240.0030.01315.02
7.2.230.0030.01015.11
7.2.220.0030.01215.18
7.2.210.0030.00615.04
7.2.200.0090.00915.10
7.2.190.0160.00015.10
7.2.180.0040.01214.88
7.2.170.0070.01015.02
7.2.160.0110.00414.92
7.2.150.0060.00316.75
7.2.140.0110.00416.66
7.2.130.0060.01016.77
7.2.120.0120.00616.86
7.2.110.0040.01116.77
7.2.100.0100.00716.76
7.2.90.0080.00816.92
7.2.80.0030.01216.72
7.2.70.0100.00316.65
7.2.60.0100.00516.95
7.2.50.0090.00917.03
7.2.40.0030.01316.75
7.2.30.0060.01217.00
7.2.20.0100.00716.93
7.2.10.0040.01516.82
7.2.00.0060.00916.73
7.1.330.0100.00715.64
7.1.320.0030.01315.80
7.1.310.0040.00715.62
7.1.300.0000.01315.84
7.1.290.0030.01516.04
7.1.280.0000.01515.98
7.1.270.0060.00915.76
7.1.260.0060.00315.40
7.1.250.0120.00315.93
7.1.200.0060.00315.73
7.1.70.0100.00017.14
7.1.60.0060.01819.70
7.1.50.0100.01016.72
7.1.00.0000.07722.42
7.0.200.0000.00716.81
7.0.140.0070.06721.93
7.0.60.0030.07020.06
7.0.50.0000.04317.86
7.0.40.0100.07719.93
7.0.30.0530.05020.33
7.0.20.0270.06320.04
7.0.10.0300.07320.24
7.0.00.0100.07720.27
5.6.280.0130.06721.10
5.6.210.0070.07020.63
5.6.200.0070.04318.12
5.6.190.0100.07320.41
5.6.180.4100.04020.77
5.6.170.0300.05020.50
5.6.160.0070.06320.48
5.6.150.0030.08318.18
5.6.140.0030.03718.18
5.6.130.0000.05018.17
5.6.120.0100.08020.98
5.6.110.0130.08321.01
5.6.100.0230.07021.12
5.6.90.0070.08020.98
5.6.80.0170.07020.30
5.6.70.0370.06320.38
5.5.350.0300.07020.39
5.5.340.0100.08317.95
5.5.330.0070.08320.36
5.5.320.0200.03720.13
5.5.310.0500.06720.28
5.5.300.0100.07717.95
5.5.290.0000.07017.87
5.5.280.0100.07320.81
5.5.270.0100.04020.97
5.5.260.0030.08320.77
5.5.250.0030.08320.56
5.5.240.0030.03720.36
5.4.450.1400.04719.25
5.4.440.0300.04719.49
5.4.430.0800.06019.18
5.4.420.0700.00019.62
5.4.410.0130.05718.89
5.4.400.0300.07318.75
5.4.390.0300.05318.60
5.4.380.0370.04318.42
5.4.370.0070.04318.71
5.4.360.0100.05318.70
5.4.350.0080.04412.00
5.4.340.0100.04411.99
5.4.320.0090.03712.47
5.4.310.0070.04412.47
5.4.300.0060.03812.47
5.4.290.0070.05712.47
5.4.280.0100.05212.37
5.4.270.0140.05312.37
5.4.260.0110.06512.36
5.4.250.0050.05412.37
5.4.240.0050.05412.36
5.4.230.0100.05012.36
5.4.220.0130.05212.36
5.4.210.0090.04912.36
5.4.200.0130.04612.36
5.4.190.0060.05312.35
5.4.180.0070.05112.35
5.4.170.0070.05212.36
5.4.160.0100.05412.36
5.4.150.0100.05212.36
5.4.140.0110.05312.04
5.4.130.0090.04512.03
5.4.120.0070.05211.99
5.4.110.0080.06611.98
5.4.100.0120.04911.98
5.4.90.0050.05411.98
5.4.80.0100.05011.98
5.4.70.0120.05411.98
5.4.60.0050.05511.98
5.4.50.0140.04711.98
5.4.40.0100.04511.96
5.4.30.0140.05011.97
5.4.20.0100.05411.96
5.4.10.0110.04711.97
5.4.00.0120.06211.45
5.3.290.0080.04412.80
5.3.280.0140.04412.71
5.3.270.0060.04412.72
5.3.260.0080.03812.72
5.3.250.0050.04012.72
5.3.240.0060.04212.72
5.3.230.0080.04112.70
5.3.220.0040.04212.68
5.3.210.0100.03812.68
5.3.200.0040.04212.68
5.3.190.0050.04312.68
5.3.180.0080.03912.68
5.3.170.0140.04612.66
5.3.160.0080.05712.67
5.3.150.0120.05912.68
5.3.140.0100.04912.66
5.3.130.0210.08112.66
5.3.120.0100.06212.66
5.3.110.0120.05212.65
5.3.100.0140.04312.11
5.3.90.0080.05312.09
5.3.80.0100.03712.08
5.3.70.0090.03612.08
5.3.60.0100.03712.06
5.3.50.0070.05812.02
5.3.40.0130.05512.02
5.3.30.0080.06611.98
5.3.20.0110.04811.75
5.3.10.0080.05011.72
5.3.00.0130.06411.71
5.2.170.0080.0389.21
5.2.160.0040.0459.21
5.2.150.0060.0339.21
5.2.140.0080.0309.21
5.2.130.0050.0329.17
5.2.120.0040.0319.17
5.2.110.0090.0289.17
5.2.100.0070.0389.17
5.2.90.0040.0329.17
5.2.80.0070.0299.16
5.2.70.0060.0329.16
5.2.60.0080.0319.12
5.2.50.0080.0319.09
5.2.40.0090.0329.07
5.2.30.0090.0349.05
5.2.20.0110.0549.03
5.2.10.0070.0368.96
5.2.00.0070.0658.81
5.1.60.0180.0528.09
5.1.50.0050.0278.09
5.1.40.0100.0228.08
5.1.30.0050.0278.43
5.1.20.0040.0318.45
5.1.10.0060.0268.17
5.1.00.0060.0328.16
5.0.50.0060.0276.65
5.0.40.0070.0186.51
5.0.30.0130.0486.33
5.0.20.0090.0226.29
5.0.10.0070.0276.27
5.0.00.0040.0426.26
4.4.90.0080.0184.78
4.4.80.0040.0214.76
4.4.70.0030.0224.75
4.4.60.0070.0204.75
4.4.50.0040.0224.77
4.4.40.0020.0364.71
4.4.30.0060.0194.75
4.4.20.0060.0204.84
4.4.10.0030.0224.85
4.4.00.0020.0534.76
4.3.110.0080.0204.67
4.3.100.0040.0304.66
4.3.90.0030.0154.63
4.3.80.0020.0274.59
4.3.70.0030.0164.63
4.3.60.0060.0174.63
4.3.50.0040.0184.63
4.3.40.0040.0284.54
4.3.30.0030.0203.31
4.3.20.0040.0173.29
4.3.10.0050.0303.25
4.3.00.0200.01014.93

preferences:
48.46 ms | 401 KiB | 5 Q