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.0130.00318.55
8.3.50.0080.01016.51
8.3.40.0130.01018.84
8.3.30.0110.00418.88
8.3.20.0090.00018.85
8.3.10.0050.00518.89
8.3.00.0030.00719.50
8.2.180.0070.01316.75
8.2.170.0090.00622.96
8.2.160.0090.00618.83
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00321.06
8.2.110.0000.00920.22
8.2.100.0040.00819.83
8.2.90.0050.00517.63
8.2.80.0000.00818.78
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0030.00618.07
8.2.40.0050.00319.66
8.2.30.0030.00617.75
8.2.20.0060.00617.71
8.2.10.0040.00417.70
8.2.00.0060.00317.64
8.1.280.0180.00325.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00018.98
8.1.230.0040.00717.89
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0060.00318.75
8.1.160.0000.00718.93
8.1.150.0080.00018.79
8.1.140.0050.00217.55
8.1.130.0030.00317.87
8.1.120.0040.00417.51
8.1.110.0020.00517.50
8.1.100.0040.00417.43
8.1.90.0050.00317.50
8.1.80.0030.00517.50
8.1.70.0000.00717.46
8.1.60.0040.00417.50
8.1.50.0040.00417.43
8.1.40.0000.00717.60
8.1.30.0000.01117.67
8.1.20.0060.00317.53
8.1.10.0040.00417.63
8.1.00.0000.00917.52
8.0.300.0040.00418.77
8.0.290.0000.00916.88
8.0.280.0000.00718.66
8.0.270.0040.00417.05
8.0.260.0070.00016.73
8.0.250.0050.00317.04
8.0.240.0040.00416.98
8.0.230.0000.00717.01
8.0.220.0080.00016.89
8.0.210.0000.00716.84
8.0.200.0030.00617.03
8.0.190.0030.00517.02
8.0.180.0060.00316.92
8.0.170.0080.00316.91
8.0.160.0030.00516.84
8.0.150.0040.00416.79
8.0.140.0020.00916.89
8.0.130.0000.00613.34
8.0.120.0070.00316.97
8.0.110.0050.00216.86
8.0.100.0000.00816.95
8.0.90.0050.00216.87
8.0.80.0110.01116.97
8.0.70.0000.00817.04
8.0.60.0000.00816.97
8.0.50.0000.00816.89
8.0.30.0100.01017.16
8.0.20.0150.00617.06
8.0.10.0060.00317.02
8.0.00.0080.01416.83
7.4.330.0050.00013.14
7.4.320.0060.00016.86
7.4.300.0000.00716.69
7.4.290.0030.00516.82
7.4.280.0080.00016.71
7.4.270.0000.00716.73
7.4.260.0060.00013.43
7.4.250.0060.00316.56
7.4.240.0070.00016.68
7.4.230.0070.00016.83
7.4.220.0090.00916.68
7.4.210.0120.00616.84
7.4.200.0030.00316.86
7.4.190.0070.00016.87
7.4.160.0060.00916.69
7.4.150.0050.01416.64
7.4.140.0090.01016.61
7.4.130.0100.01316.65
7.4.120.0120.00616.45
7.4.110.0190.00416.72
7.4.100.0150.00316.71
7.4.90.0130.00516.55
7.4.80.0040.01519.39
7.4.70.0120.01116.76
7.4.60.0140.00416.48
7.4.50.0080.00016.54
7.4.40.0040.00716.67
7.4.30.0100.01416.55
7.4.10.0120.00914.89
7.4.00.0030.01315.00
7.3.330.0000.00613.04
7.3.320.0070.00013.15
7.3.310.0070.00016.45
7.3.300.0030.00316.29
7.3.290.0080.00816.35
7.3.280.0060.00916.35
7.3.270.0140.00416.38
7.3.260.0120.00916.53
7.3.250.0090.01016.46
7.3.240.0130.00716.52
7.3.230.0100.00716.58
7.3.210.0120.00616.51
7.3.200.0100.01416.32
7.3.190.0100.00716.57
7.3.180.0050.01116.26
7.3.170.0090.01216.36
7.3.160.0090.00816.41
7.3.130.0090.00914.48
7.3.120.0050.01214.78
7.3.110.0080.01014.88
7.3.100.0080.00614.85
7.3.90.0020.01414.98
7.3.80.0020.00914.88
7.3.70.0090.00714.93
7.3.60.0040.00914.85
7.3.50.0040.01114.78
7.3.40.0060.00614.81
7.3.30.0020.01014.73
7.3.20.0050.01016.75
7.3.10.0090.00516.72
7.3.00.0030.01216.74
7.2.330.0100.00716.36
7.2.320.0060.01216.55
7.2.310.0060.01516.52
7.2.300.0110.00716.56
7.2.290.0110.00716.53
7.2.260.0040.01515.00
7.2.250.0110.00715.03
7.2.240.0070.01214.87
7.2.230.0080.00714.97
7.2.220.0060.00715.10
7.2.210.0040.00915.01
7.2.200.0080.00615.04
7.2.190.0040.01214.98
7.2.180.0080.00815.00
7.2.170.0080.00615.22
7.2.160.0090.00014.95
7.2.150.0000.01216.86
7.2.140.0100.00316.75
7.2.130.0060.00316.75
7.2.120.0040.00716.82
7.2.110.0070.01116.89
7.2.100.0100.00316.69
7.2.90.0040.00816.91
7.2.80.0030.01316.94
7.2.70.0120.00317.00
7.2.60.0050.00816.75
7.2.50.0030.01016.96
7.2.40.0040.01516.71
7.2.30.0030.00716.66
7.2.20.0100.00717.05
7.2.10.0060.00616.73
7.2.00.0030.01018.00
7.1.330.0070.00715.99
7.1.320.0060.00615.60
7.1.310.0060.00615.71
7.1.300.0030.01015.76
7.1.290.0050.00715.97
7.1.280.0050.00715.76
7.1.270.0050.00715.76
7.1.260.0020.01015.77
7.1.250.0000.01315.66
7.1.240.0040.00815.75
7.1.230.0130.00016.04
7.1.220.0070.00715.83
7.1.210.0030.00715.89
7.1.200.0090.00315.98
7.1.190.0110.00315.69
7.1.180.0040.00715.91
7.1.170.0060.00615.63
7.1.160.0100.00715.81
7.1.150.0040.01216.08
7.1.140.0070.01015.90
7.1.130.0120.00316.05
7.1.120.0060.00815.88
7.1.110.0030.01315.89
7.1.100.0040.00617.06
7.1.90.0090.00015.93
7.1.80.0060.00916.10
7.1.70.0060.00616.67
7.1.60.0070.01217.65
7.1.50.0050.00916.27
7.1.40.0070.01015.71
7.1.30.0000.00916.02
7.1.20.0030.01515.92
7.1.10.0040.00715.86
7.1.00.0050.04119.27
7.0.330.0100.00015.42
7.0.320.0060.00615.39
7.0.310.0120.00015.64
7.0.300.0000.01315.35
7.0.290.0080.00315.51
7.0.280.0030.01315.18
7.0.270.0040.00415.54
7.0.260.0070.00715.50
7.0.250.0030.00715.73
7.0.240.0110.00015.60
7.0.230.0100.00315.40
7.0.220.0070.00715.48
7.0.210.0030.00715.77
7.0.200.0030.00816.10
7.0.190.0030.01015.53
7.0.180.0030.01015.56
7.0.170.0090.00615.23
7.0.160.0060.00615.46
7.0.150.0060.00615.52
7.0.140.0020.04118.62
7.0.130.0000.01315.66
7.0.120.0060.03818.82
7.0.110.0040.00415.60
7.0.100.0110.00415.68
7.0.90.0100.00315.36
7.0.80.0070.00315.68
7.0.70.0060.00915.73
7.0.60.0050.02317.87
7.0.50.0050.02416.94
7.0.40.0080.02316.69
7.0.30.0220.02716.62
7.0.20.0150.03216.94
7.0.10.0050.03316.94
7.0.00.0060.04116.92
5.6.400.0040.00713.99
5.6.390.0090.00314.00
5.6.380.0030.00914.41
5.6.370.0000.00914.18
5.6.360.0080.00814.51
5.6.350.0080.00414.33
5.6.340.0030.01314.25
5.6.330.0070.00714.52
5.6.320.0030.00914.20
5.6.310.0060.00614.12
5.6.300.0040.00813.90
5.6.290.0090.00614.06
5.6.280.0090.03517.51
5.6.270.0030.00713.97
5.6.260.0070.00713.96
5.6.250.0090.00614.11
5.6.240.0040.00414.09
5.6.230.0100.00014.18
5.6.220.0040.00713.95
5.6.210.0030.04417.38
5.6.200.0050.04616.24
5.6.190.0080.03617.27
5.6.180.0220.04317.51
5.6.170.0170.03317.20
5.6.160.0120.04017.34
5.6.150.0070.02316.09
5.6.140.0100.02916.22
5.6.130.0050.04516.06
5.6.120.0060.04017.48
5.6.110.0070.04217.62
5.6.100.0060.02217.64
5.6.90.0100.03817.51
5.6.80.0110.03917.40
5.6.70.0100.00014.14
5.6.60.0090.00014.13
5.6.50.0060.00613.95
5.6.40.0090.00613.88
5.6.30.0100.00313.86
5.6.20.0030.01314.21
5.6.10.0040.01113.86
5.6.00.0000.01614.14
5.5.380.0030.01414.27
5.5.370.0100.00314.39
5.5.360.0030.01414.01
5.5.350.0040.04617.28
5.5.340.0050.04516.13
5.5.330.0070.03017.34
5.5.320.0030.03917.32
5.5.310.0130.03517.17
5.5.300.0050.04515.91
5.5.290.0040.04216.10
5.5.280.0080.03317.44
5.5.270.0090.02917.37
5.5.260.0130.03917.40
5.5.250.0070.04017.26
5.5.240.0100.02717.20
5.5.230.0100.00714.16
5.5.220.0070.00414.33
5.5.210.0100.00314.15
5.5.200.0080.00014.24
5.5.190.0090.00614.03
5.5.180.0030.00614.09
5.5.170.0100.00714.13
5.5.160.0030.01214.14
5.5.150.0070.00714.18
5.5.140.0060.00814.00
5.5.130.0100.00314.21
5.5.120.0040.00413.95
5.5.110.0000.01013.87
5.5.100.0100.00013.86
5.5.90.0040.00713.83
5.5.80.0030.00914.06
5.5.70.0040.01114.20
5.5.60.0040.00413.89
5.5.50.0030.00614.31
5.5.40.0120.00413.82
5.5.30.0030.01014.18
5.5.20.0030.01213.85
5.5.10.0060.00913.82
5.5.00.0000.01413.81
5.4.450.0050.02315.02
5.4.440.0020.03915.19
5.4.430.0020.02815.05
5.4.420.0000.02615.06
5.4.410.0030.03215.11
5.4.400.0090.03715.01
5.4.390.0050.02314.82
5.4.380.0080.02214.82
5.4.370.0100.02614.99
5.4.360.0080.03914.82
5.4.350.0030.02615.06
5.4.340.0080.03914.91
5.4.330.0030.01010.71
5.4.320.0060.02215.05
5.4.310.0050.02215.05
5.4.300.0040.02114.87
5.4.290.0070.01714.84
5.4.280.0050.02414.94
5.4.270.0070.02015.02
5.4.260.0000.02415.02
5.4.250.0050.02214.88
5.4.240.0030.02214.86
5.4.230.0080.01514.83
5.4.220.0080.01814.96
5.4.210.0030.02014.96
5.4.200.0070.02014.95
5.4.190.0020.02514.60
5.4.180.0050.02314.96
5.4.170.0040.02014.93
5.4.160.0070.01714.83
5.4.150.0060.01815.06
5.4.140.0030.02013.57
5.4.130.0030.02313.55
5.4.120.0080.02113.77
5.4.110.0080.01513.61
5.4.100.0020.02013.59
5.4.90.0050.01713.62
5.4.80.0020.02513.65
5.4.70.0000.03013.69
5.4.60.0020.03513.62
5.4.50.0040.03013.64
5.4.40.0050.03013.54
5.4.30.0000.02413.61
5.4.20.0060.02013.57
5.4.10.0020.02313.60
5.4.00.0000.02813.24
5.3.290.0030.02312.47
5.3.280.0040.02212.39
5.3.270.0030.02312.37
5.3.260.0020.02412.49
5.3.250.0030.02212.49
5.3.240.0030.02312.41
5.3.230.0060.02112.37
5.3.220.0060.01912.42
5.3.210.0050.02012.36
5.3.200.0070.01912.44
5.3.190.0010.02112.59
5.3.180.0060.01912.50
5.3.170.0030.02012.35
5.3.160.0050.03012.50
5.3.150.0120.03312.47
5.3.140.0050.03012.40
5.3.130.0060.04112.35
5.3.120.0040.02312.41
5.3.110.0020.02512.50
5.3.100.0050.03712.20
5.3.90.0020.03512.23
5.3.80.0020.03512.06
5.3.70.0080.02812.09
5.3.60.0060.03312.11
5.3.50.0100.03512.04
5.3.40.0050.04212.00
5.3.30.0030.02312.04
5.3.20.0060.03112.01
5.3.10.0050.03711.88
5.3.00.0100.03511.85
5.2.170.0030.03011.23
5.2.160.0100.02311.11
5.2.150.0030.04011.15
5.2.140.0030.06311.13
5.2.130.0130.03011.03
5.2.120.0070.03711.08
5.2.110.0000.06010.95
5.2.100.0000.04311.07
5.2.90.0030.05311.09
5.2.80.0030.05311.08
5.2.70.0100.03011.04
5.2.60.0000.03310.90
5.2.50.0070.03310.88
5.2.40.0100.06010.86
5.2.30.0030.05010.97
5.2.20.0070.04310.89
5.2.10.0100.05010.86
5.2.00.0130.05010.79
5.1.60.0030.0339.89
5.1.50.0070.0539.98
5.1.40.0030.0579.99
5.1.30.0000.04010.49
5.1.20.0030.06010.43
5.1.10.0000.05310.08
5.1.00.0070.0479.97
5.0.50.0030.0378.54
5.0.40.0000.0278.42
5.0.30.0030.0338.06
5.0.20.0000.0438.10
5.0.10.0030.0438.12
5.0.00.0000.0508.12
4.4.90.0030.0177.81
4.4.80.0000.0177.81
4.4.70.0000.0407.81
4.4.60.0070.0307.81
4.4.50.0000.0207.81
4.4.40.0070.0537.81
4.4.30.0030.0137.81
4.4.20.0000.0377.81
4.4.10.0030.0237.81
4.4.00.0070.0237.81
4.3.110.0030.0137.81
4.3.100.0000.0377.81
4.3.90.0030.0207.81
4.3.80.0030.0377.81
4.3.70.0030.0177.81
4.3.60.0030.0177.81
4.3.50.0070.0277.81
4.3.40.0070.0277.81
4.3.30.0000.0377.81
4.3.20.0000.0277.81
4.3.10.0000.0407.81
4.3.00.0000.0177.81

preferences:
48.37 ms | 401 KiB | 5 Q