3v4l.org

run code in 300+ PHP versions simultaneously
<?php // initial position var_dump(preg_match('#/search/(?P<mac>(?:[[:xdigit:]]{2}([-:]))(?:[[:xdigit:]]{2}\2){4}[[:xdigit:]]{2})#', '/search/12-12-12-12-12-12', $matches)); var_dump($matches); // named subpattern var_dump(preg_match('#/search/(?P<mac>(?:[[:xdigit:]]{2}(?P<sep>[-:]))(?:[[:xdigit:]]{2}(?P=sep)){4}[[:xdigit:]]{2})#', '/search/12-12-12-12-12-12', $matches)); var_dump($matches); // impossible to fix in general var_dump(preg_match('#/(?P<id>\d+)/(?P<mac>(?:[[:xdigit:]]{2}([-:]))(?:[[:xdigit:]]{2}\3){4}[[:xdigit:]]{2})#', '/555/12-12-12-12-12-12', $matches)); var_dump($matches); //fix var_dump(preg_match('#((?:[[:xdigit:]]{2}([-:]))(?:[[:xdigit:]]{2}\2){4}[[:xdigit:]]{2})#', '12-12-12-12-12-12', $matches)); var_dump($matches); // problem //var_dump(preg_match('#(?:[[:xdigit:]]{2}([-:]))(?:[[:xdigit:]]{2}\2){4}[[:xdigit:]]{2}#', '12-12-12-12-12-12', $matches)); //var_dump($matches);

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.0120.00918.56
8.3.50.0090.00722.27
8.3.40.0090.00619.01
8.3.30.0090.00619.05
8.3.20.0000.00820.03
8.3.10.0030.00623.71
8.3.00.0060.00617.63
8.2.180.0070.01416.63
8.2.170.0090.00622.96
8.2.160.0030.01020.38
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0110.00422.15
8.2.110.0030.00622.21
8.2.100.0090.00317.84
8.2.90.0050.00319.15
8.2.80.0040.00417.97
8.2.70.0050.00317.50
8.2.60.0040.00417.91
8.2.50.0050.00318.07
8.2.40.0080.00018.16
8.2.30.0040.00418.13
8.2.20.0000.00817.88
8.2.10.0000.00817.93
8.2.00.0000.00717.88
8.1.280.0070.01125.92
8.1.270.0030.00522.18
8.1.260.0110.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00923.73
8.1.230.0080.00319.28
8.1.220.0000.00817.79
8.1.210.0030.00518.77
8.1.200.0030.00617.60
8.1.190.0000.00817.53
8.1.180.0040.00418.10
8.1.170.0060.00318.81
8.1.160.0000.00722.02
8.1.150.0040.00418.81
8.1.140.0030.00517.58
8.1.130.0070.00017.89
8.1.120.0050.00317.46
8.1.110.0040.00417.52
8.1.100.0050.00217.40
8.1.90.0040.00417.50
8.1.80.0030.00517.49
8.1.70.0000.00817.45
8.1.60.0080.00017.64
8.1.50.0060.00317.58
8.1.40.0080.00017.54
8.1.30.0000.00917.57
8.1.20.0000.00817.64
8.1.10.0060.00317.57
8.1.00.0040.00417.42
8.0.300.0050.00218.77
8.0.290.0030.00617.18
8.0.280.0000.00718.38
8.0.270.0070.00017.08
8.0.260.0030.00316.79
8.0.250.0030.00317.01
8.0.240.0000.00817.04
8.0.230.0050.00317.02
8.0.220.0000.00716.96
8.0.210.0070.00016.88
8.0.200.0000.00717.05
8.0.190.0030.00516.97
8.0.180.0070.00016.99
8.0.170.0080.00017.00
8.0.160.0040.00416.81
8.0.150.0020.00516.86
8.0.140.0080.00016.92
8.0.130.0040.00413.38
8.0.120.0040.00416.97
8.0.110.0070.00017.01
8.0.100.0040.00417.08
8.0.90.0040.00417.00
8.0.80.0100.00616.95
8.0.70.0000.00717.06
8.0.60.0050.00216.90
8.0.50.0040.00416.96
8.0.30.0200.00417.24
8.0.20.0090.01117.40
8.0.10.0060.00317.18
8.0.00.0100.01316.87
7.4.330.0030.00315.12
7.4.320.0030.00316.59
7.4.300.0050.00216.74
7.4.290.0030.00316.59
7.4.280.0030.00316.83
7.4.270.0040.00416.77
7.4.260.0070.00016.73
7.4.250.0040.00416.70
7.4.240.0020.00516.67
7.4.230.0040.00416.68
7.4.220.0090.00916.73
7.4.210.0120.00416.70
7.4.200.0070.00016.79
7.4.190.0000.00816.67
7.4.160.0150.00316.85
7.4.150.0110.00817.40
7.4.140.0160.00617.86
7.4.130.0140.00616.68
7.4.120.0070.01116.57
7.4.110.0070.01116.51
7.4.100.0070.01416.63
7.4.90.0110.01416.40
7.4.80.0150.00319.39
7.4.70.0130.00316.51
7.4.60.0030.01316.53
7.4.50.0060.00316.48
7.4.40.0060.01222.77
7.4.30.0070.01616.70
7.4.10.0040.01414.90
7.4.00.0050.01214.93
7.3.330.0000.00613.22
7.3.320.0000.00513.14
7.3.310.0000.00716.39
7.3.300.0030.00316.34
7.3.290.0110.00416.35
7.3.280.0090.01116.41
7.3.270.0060.01517.40
7.3.260.0170.00316.68
7.3.250.0150.00316.49
7.3.240.0060.01416.68
7.3.230.0040.01416.65
7.3.210.0050.01416.38
7.3.200.0170.00319.39
7.3.190.0160.00616.44
7.3.180.0100.00816.47
7.3.170.0060.00916.45
7.3.160.0120.00516.34
7.3.130.0130.00614.82
7.3.120.0100.00714.76
7.3.110.0030.01415.13
7.3.100.0070.01014.71
7.3.90.0040.01115.03
7.3.80.0040.01114.80
7.3.70.0000.00915.01
7.3.60.0130.00014.68
7.3.50.0080.00714.64
7.3.40.0060.00614.95
7.3.30.0030.01414.74
7.3.20.0040.01116.69
7.3.10.0060.00316.73
7.3.00.0030.00616.42
7.2.330.0160.00516.47
7.2.320.0110.00816.58
7.2.310.0100.01316.55
7.2.300.0040.01516.61
7.2.290.0100.01016.70
7.2.260.0040.01115.05
7.2.250.0030.01315.07
7.2.240.0090.00615.27
7.2.230.0060.00915.07
7.2.220.0100.01014.98
7.2.210.0070.00715.04
7.2.200.0070.01115.16
7.2.190.0030.01215.29
7.2.180.0030.00615.00
7.2.170.0020.00815.06
7.2.160.0040.00714.97
7.2.150.0100.00716.72
7.2.140.0040.01016.89
7.2.130.0090.00316.94
7.2.120.0110.00716.86
7.2.110.0070.00716.76
7.2.100.0030.01316.93
7.2.90.0060.00916.97
7.2.80.0060.00917.18
7.2.70.0070.00716.82
7.2.60.0090.00616.88
7.2.50.0030.01016.96
7.2.40.0100.00716.70
7.2.30.0040.01216.90
7.2.20.0060.01117.10
7.2.10.0090.00616.95
7.2.00.0080.00818.28
7.1.330.0110.00415.82
7.1.320.0030.01315.93
7.1.310.0040.00815.91
7.1.300.0040.01115.99
7.1.290.0040.00815.86
7.1.280.0030.01016.05
7.1.270.0050.00515.96
7.1.260.0070.00715.69
7.1.250.0120.00315.81
7.1.240.0090.00615.73
7.1.230.0030.00915.65
7.1.220.0030.01315.85
7.1.210.0040.01115.80
7.1.200.0120.00015.79
7.1.190.0040.01115.97
7.1.180.0040.01215.79
7.1.170.0000.01715.59
7.1.160.0030.00715.91
7.1.150.0000.01515.76
7.1.140.0030.00715.67
7.1.130.0060.00915.71
7.1.120.0040.00715.89
7.1.110.0100.00315.90
7.1.100.0030.01117.02
7.1.90.0110.00415.93
7.1.80.0090.00615.69
7.1.70.0080.00616.60
7.1.60.0060.01017.71
7.1.50.0040.01616.58
7.1.40.0070.00715.84
7.1.30.0070.00315.89
7.1.20.0030.00915.95
7.1.10.0000.01115.64
7.1.00.0080.03819.15
7.0.330.0100.00515.39
7.0.320.0030.01015.74
7.0.310.0040.01115.59
7.0.300.0030.01015.32
7.0.290.0080.00515.59
7.0.280.0040.00815.20
7.0.270.0090.00915.36
7.0.260.0100.00615.52
7.0.250.0000.01615.62
7.0.240.0060.00615.29
7.0.230.0060.00615.38
7.0.220.0030.00815.37
7.0.210.0100.00315.32
7.0.200.0080.00516.18
7.0.190.0120.00315.52
7.0.180.0070.00715.71
7.0.170.0000.01415.54
7.0.160.0060.00615.24
7.0.150.0060.00315.55
7.0.140.0050.03818.84
7.0.130.0110.00315.52
7.0.120.0050.00515.32
7.0.110.0100.00315.45
7.0.100.0100.03817.67
7.0.90.0050.04517.76
7.0.80.0130.04017.66
7.0.70.0110.03817.70
7.0.60.0100.04317.70
7.0.50.0080.04918.18
7.0.40.0080.04116.90
7.0.30.0040.04316.92
7.0.20.0080.04116.82
7.0.10.0070.04716.83
7.0.00.0120.04216.75
5.6.400.0000.01414.40
5.6.390.0060.01014.38
5.6.380.0040.00713.97
5.6.370.0090.00314.19
5.6.360.0000.01513.87
5.6.350.0090.00614.05
5.6.340.0070.01014.20
5.6.330.0120.00414.18
5.6.320.0090.00413.98
5.6.310.0130.00313.94
5.6.300.0000.01713.86
5.6.290.0030.01014.31
5.6.280.0050.03617.37
5.6.270.0070.00714.25
5.6.260.0000.01114.25
5.6.250.0080.04217.35
5.6.240.0070.04217.23
5.6.230.0100.04517.32
5.6.220.0030.05117.38
5.6.210.0100.04217.39
5.6.200.0130.04017.57
5.6.190.0090.04417.53
5.6.180.0070.04217.60
5.6.170.0030.04817.64
5.6.160.0080.04417.74
5.6.150.0060.04617.58
5.6.140.0110.04117.60
5.6.130.0080.03017.59
5.6.120.0040.04717.59
5.6.110.0080.04517.73
5.6.100.0050.04717.61
5.6.90.0100.02517.51
5.6.80.0070.04317.16
5.6.70.0070.04417.31
5.6.60.0060.02917.20
5.6.50.0050.03017.29
5.6.40.0030.02917.28
5.6.30.0070.02417.38
5.6.20.0080.04017.35
5.6.10.0030.04617.21
5.6.00.0080.03917.23
5.5.380.0030.04617.31
5.5.370.0050.04717.30
5.5.360.0100.04217.36
5.5.350.0080.04017.26
5.5.340.0100.04317.33
5.5.330.0090.04217.27
5.5.320.0080.02917.24
5.5.310.0100.04017.29
5.5.300.0100.02817.41
5.5.290.0100.03717.38
5.5.280.0080.04017.61
5.5.270.0090.04217.53
5.5.260.0030.04517.63
5.5.250.0040.04517.31
5.5.240.0050.02717.12
5.5.230.0070.04217.20
5.5.220.0090.02517.25
5.5.210.0050.03717.13
5.5.200.0080.03817.24
5.5.190.0050.04317.09
5.5.180.0050.04017.08
5.5.170.0040.01113.71
5.5.160.0040.02917.15
5.5.150.0110.03817.04
5.5.140.0070.04417.07
5.5.130.0050.03317.17
5.5.120.0070.03816.93
5.5.110.0100.04017.08
5.5.100.0050.04017.12
5.5.90.0070.04217.12
5.5.80.0130.03317.09
5.5.70.0070.04417.05
5.5.60.0030.03116.93
5.5.50.0100.03716.95
5.5.40.0130.03517.02
5.5.30.0060.04216.98
5.5.20.0130.04316.96
5.5.10.0040.04616.90
5.5.00.0080.04516.77
5.4.450.0030.04316.08
5.4.440.0120.03916.05
5.4.430.0090.04215.99
5.4.420.0140.03516.00
5.4.410.0040.04016.00
5.4.400.0040.04215.84
5.4.390.0070.04015.73
5.4.380.0070.04115.91
5.4.370.0060.03815.76
5.4.360.0100.03615.92
5.4.350.0080.02115.88
5.4.340.0020.04415.90
5.4.330.0060.00612.70
5.4.320.0040.04015.76
5.4.310.0060.03715.84
5.4.300.0070.03715.88
5.4.290.0090.03815.74
5.4.280.0100.04015.91
5.4.270.0080.04015.83
5.4.260.0020.04315.86
5.4.250.0060.04215.83
5.4.240.0070.02215.96
5.4.230.0080.03815.86
5.4.220.0080.03615.75
5.4.210.0090.03615.79
5.4.200.0030.02715.86
5.4.190.0140.03415.88
5.4.180.0020.04315.87
5.4.170.0070.04215.79
5.4.160.0160.03015.82
5.4.150.0080.02315.85
5.4.140.0110.02214.56
5.4.130.0110.03314.56
5.4.120.0050.03914.56
5.4.110.0080.04014.54
5.4.100.0080.03814.48
5.4.90.0040.03614.48
5.4.80.0100.03414.55
5.4.70.0030.04314.57
5.4.60.0050.03514.45
5.4.50.0100.03614.55
5.4.40.0080.04014.48
5.4.30.0030.04414.47
5.4.20.0050.03714.53
5.4.10.0020.04114.54
5.4.00.0060.03814.21
5.3.290.0070.03213.61
5.3.280.0050.04313.55
5.3.270.0050.04213.65
5.3.260.0050.03813.58
5.3.250.0080.03813.65
5.3.240.0070.03713.56
5.3.230.0050.04213.58
5.3.220.0050.04213.56
5.3.210.0060.03613.61
5.3.200.0030.04113.61
5.3.190.0050.04013.59
5.3.180.0080.03513.56
5.3.170.0050.04013.61
5.3.160.0100.03513.62
5.3.150.0070.02413.54
5.3.140.0070.03213.56
5.3.130.0050.03713.62
5.3.120.0080.03813.60
5.3.110.0030.04313.60
5.3.100.0060.04113.36
5.3.90.0070.03813.34
5.3.80.0070.03213.36
5.3.70.0090.03513.33
5.3.60.0050.03613.29
5.3.50.0020.04613.31
5.3.40.0020.04113.31
5.3.30.0040.04013.30
5.3.20.0030.03813.08
5.3.10.0050.03913.13
5.3.00.0060.02713.10
5.2.170.0170.05311.13
5.2.160.0100.05711.15
5.2.150.0070.06311.17
5.2.140.0070.06011.19
5.2.130.0030.06311.08
5.2.120.0100.05711.15
5.2.110.0070.06710.96
5.2.100.0030.06011.15
5.2.90.0070.05711.10
5.2.80.0130.04710.96
5.2.70.0000.07011.06
5.2.60.0070.05711.05
5.2.50.0100.05710.88
5.2.40.0130.05310.82
5.2.30.0000.05710.97
5.2.20.0030.05710.95
5.2.10.0130.05010.88
5.2.00.0030.06010.64
5.1.60.0070.05710.07
5.1.50.0070.05310.03
5.1.40.0100.05010.08
5.1.30.0030.06310.34
5.1.20.0130.05310.40
5.1.10.0030.05710.10
5.1.00.0070.0479.91
5.0.50.0030.0508.44
5.0.40.0070.0438.29
5.0.30.0030.0638.14
5.0.20.0070.0408.30
5.0.10.0000.0378.29
5.0.00.0070.0608.18
4.4.90.0070.0338.14
4.4.80.0000.0378.14
4.4.70.0030.0338.14
4.4.60.0000.0378.14
4.4.50.0000.0378.14
4.4.40.0030.0378.14
4.4.30.0100.0308.14
4.4.20.0000.0378.14
4.4.10.0070.0308.14
4.4.00.0000.0538.14
4.3.110.0030.0338.14
4.3.100.0000.0378.14
4.3.90.0000.0378.17
4.3.80.0000.0578.17
4.3.70.0070.0338.17
4.3.60.0030.0338.17
4.3.50.0000.0378.17
4.3.40.0000.0578.17
4.3.30.0030.0308.17
4.3.20.0100.0308.17
4.3.10.0000.0378.17
4.3.00.0000.0378.17

preferences:
49.82 ms | 401 KiB | 5 Q