3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tokens = [ ':rr'=>5, ':tipo'=>'\[A-Z]' ]; $regex = '/#([a-zA-z0-9_]+)(:[a-zA-Z]+)/'; $pattern = 'blog/#month:tipo/#year:rr'; echo preg_replace($regex, "(?<$1>$2)", $pattern); /*echo preg_replace_callback($regex, function (array $matches) { $tokens = [ ':rr'=>5, ':tipo'=>'\[A-Z]' ]; echo "(?<{$matches[1]}>{$tokens[$matches[2]]})"; }, $pattern);*/

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.0170.00318.21
8.3.50.0160.00721.14
8.3.40.0150.00318.83
8.3.30.0070.00720.17
8.3.20.0000.00720.25
8.3.10.0030.00520.99
8.3.00.0000.00822.43
8.2.180.0140.00717.00
8.2.170.0060.00922.96
8.2.160.0110.00422.21
8.2.150.0030.00524.18
8.2.140.0070.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00421.00
8.2.110.0110.00019.30
8.2.100.0110.00018.03
8.2.90.0040.00418.92
8.2.80.0030.00518.04
8.2.70.0040.00417.75
8.2.60.0030.00617.80
8.2.50.0000.00818.07
8.2.40.0000.00818.34
8.2.30.0040.00419.36
8.2.20.0070.00017.93
8.2.10.0050.00217.70
8.2.00.0000.00717.82
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0000.01022.39
8.1.230.0070.00420.91
8.1.220.0050.00318.77
8.1.210.0040.00420.82
8.1.200.0040.00417.35
8.1.190.0040.00417.40
8.1.180.0060.00618.10
8.1.170.0080.00018.62
8.1.160.0040.00418.75
8.1.150.0040.00418.62
8.1.140.0040.00417.43
8.1.130.0000.00717.75
8.1.120.0040.00417.45
8.1.110.0000.00717.59
8.1.100.0000.00717.52
8.1.90.0060.00317.51
8.1.80.0050.00317.44
8.1.70.0030.00317.49
8.1.60.0040.00417.56
8.1.50.0050.00217.50
8.1.40.0000.00717.55
8.1.30.0000.00817.68
8.1.20.0050.00317.77
8.1.10.0070.00017.52
8.1.00.0000.00717.59
8.0.300.0050.00219.77
8.0.290.0040.00417.05
8.0.280.0040.00418.37
8.0.270.0000.00717.27
8.0.260.0040.00416.88
8.0.250.0000.00717.11
8.0.240.0040.00417.08
8.0.230.0000.00716.96
8.0.220.0040.00416.95
8.0.210.0040.00416.93
8.0.200.0070.00017.07
8.0.190.0000.00817.07
8.0.180.0070.00016.98
8.0.170.0030.00317.05
8.0.160.0070.00016.99
8.0.150.0000.00716.91
8.0.140.0040.00817.01
8.0.130.0030.00313.39
8.0.120.0000.00816.93
8.0.110.0070.00016.90
8.0.100.0050.00317.00
8.0.90.0040.00417.05
8.0.80.0070.01316.90
8.0.70.0040.00416.86
8.0.60.0000.00716.82
8.0.50.0000.00716.86
8.0.30.0090.01317.21
8.0.20.0110.00917.40
8.0.10.0000.00716.90
8.0.00.0100.00916.84
7.4.330.0050.00016.80
7.4.320.0000.00616.64
7.4.300.0030.00316.73
7.4.290.0030.00316.55
7.4.280.0030.00316.64
7.4.270.0000.00716.55
7.4.260.0060.00013.43
7.4.250.0040.00416.77
7.4.240.0040.00416.61
7.4.230.0000.00716.69
7.4.220.0130.00716.85
7.4.210.0100.00616.69
7.4.200.0030.00316.57
7.4.190.0070.00016.71
7.4.160.0130.00316.59
7.4.150.0160.00317.40
7.4.140.0160.00517.86
7.4.130.0060.01116.53
7.4.120.0090.00816.71
7.4.110.0040.01216.68
7.4.100.0110.00616.46
7.4.90.0170.00016.53
7.4.80.0140.00819.39
7.4.70.0070.01016.45
7.4.60.0120.00916.49
7.4.50.0030.00616.67
7.4.40.0060.00922.77
7.4.30.0060.01216.59
7.4.00.0030.01315.22
7.3.330.0050.00013.13
7.3.320.0050.00013.11
7.3.310.0040.00416.25
7.3.300.0030.00316.20
7.3.290.0100.00316.27
7.3.280.0090.00916.24
7.3.270.0060.01017.40
7.3.260.0120.00818.24
7.3.250.0100.00616.55
7.3.240.0070.01416.66
7.3.230.0110.00616.54
7.3.210.0130.00316.61
7.3.200.0070.01619.39
7.3.190.0060.00916.34
7.3.180.0130.00316.52
7.3.170.0030.01316.30
7.3.160.0150.00616.51
7.3.120.0140.00314.92
7.3.10.0030.01316.53
7.3.00.0070.00716.45
7.2.330.0110.00716.86
7.2.320.0150.00616.45
7.2.310.0160.00616.45
7.2.300.0000.01616.52
7.2.290.0040.01716.64
7.2.130.0060.01316.59
7.2.120.0040.01117.02
7.2.110.0300.00016.95
7.2.100.0110.00517.09
7.2.90.0110.00417.05
7.2.80.0210.00716.79
7.2.70.0080.01016.88
7.2.60.0080.01216.64
7.2.50.0030.00916.84
7.2.40.0060.01017.06
7.2.30.0000.01217.02
7.2.20.0000.01416.82
7.2.10.0090.00916.55
7.2.00.0060.00518.07
7.1.250.0060.00615.76
7.1.100.0140.00018.17
7.1.70.0030.01216.98
7.1.60.0100.01319.17
7.1.50.0060.01917.02
7.1.00.0070.07322.50
7.0.200.0000.00716.96
7.0.140.0030.07721.96
7.0.60.0000.04319.85
7.0.50.0030.04017.85
7.0.40.0000.04720.23
7.0.30.0230.08320.22
7.0.20.0200.05720.22
7.0.10.0330.07720.04
7.0.00.0070.08720.39
5.6.280.0000.07721.14
5.6.210.0030.08720.56
5.6.200.0030.04318.16
5.6.190.0170.04020.36
5.6.180.0200.04320.64
5.6.170.0430.07720.44
5.6.160.0100.04020.37
5.6.150.0070.03718.12
5.6.140.0070.08018.20
5.6.130.0100.08318.16
5.6.120.0030.04021.13
5.6.110.0070.07720.95
5.6.100.0130.08020.98
5.6.90.0000.09021.02
5.6.80.0070.03720.43
5.6.70.4430.04020.55
5.5.350.0030.03720.52
5.5.340.0070.03717.91
5.5.330.0030.05320.16
5.5.320.4300.04020.29
5.5.310.0230.08020.21
5.5.300.0170.07017.91
5.5.290.0070.05017.89
5.5.280.0070.05320.97
5.5.270.0070.05020.75
5.5.260.0070.04020.83
5.5.250.0100.07020.54
5.5.240.0030.08320.14
5.4.450.1700.05019.58
5.4.440.1870.04319.45
5.4.430.1770.04019.43
5.4.420.1570.03319.57
5.4.410.0900.04719.02
5.4.400.0070.04318.95
5.4.390.0170.07018.99
5.4.380.1700.05318.82
5.4.370.1730.04019.25
5.4.360.1530.03718.84
5.4.350.1730.04318.71
5.4.340.1630.04318.99
5.4.320.1730.04719.15
5.4.310.1530.03718.97
5.4.300.1700.05018.73
5.4.290.1730.03718.97
5.4.280.1770.03318.95
5.4.270.1900.03319.01
5.4.260.1500.04319.02
5.4.250.1770.04318.81
5.4.240.1600.03018.98
5.4.230.1670.05018.68
5.4.220.1730.04719.15
5.4.210.1670.05019.11
5.4.200.1800.03318.68
5.4.190.1630.05318.68
5.4.180.1700.04718.96
5.4.170.1830.04018.81
5.4.160.1670.04719.09
5.4.150.1870.03718.95
5.4.140.2030.04316.27
5.4.130.2100.04016.30
5.4.120.1830.03316.40
5.4.110.1800.03016.39
5.4.100.1870.03716.39
5.4.90.1800.04016.30
5.4.80.1330.03316.41
5.4.70.1830.04016.39
5.4.60.1530.03716.41
5.4.50.1800.04016.19
5.4.40.1600.03016.49
5.4.30.1630.03716.45
5.4.20.1530.03316.04
5.4.10.1470.04016.45
5.4.00.1730.04015.89
5.3.290.1770.04014.52
5.3.280.1770.04314.45
5.3.270.1830.04014.55
5.3.260.1830.04014.46
5.3.250.1730.03714.48
5.3.240.1730.04314.45
5.3.230.1770.04314.55
5.3.220.1500.04014.41
5.3.210.1770.03714.51
5.3.200.1570.03314.48
5.3.190.1830.03714.66
5.3.180.1570.03314.43
5.3.170.1870.03314.40
5.3.160.1800.04014.58
5.3.150.1570.03714.55
5.3.140.1600.03314.49
5.3.130.1570.03714.39
5.3.120.0100.05014.41
5.3.110.0030.08014.48
5.3.100.0100.05713.95
5.3.90.0970.04313.86
5.3.80.1730.03713.81
5.3.70.1670.04013.86
5.3.60.1800.04313.86
5.3.50.1470.03713.84
5.3.40.1730.04713.79
5.3.30.1470.03713.96
5.3.20.1800.04013.53
5.3.10.1500.03013.49
5.3.00.1500.04313.59
5.2.170.1570.03711.30
5.2.160.1270.02311.19
5.2.150.1200.03311.09
5.2.140.1370.04011.16
5.2.130.1330.02310.95
5.2.120.1270.02710.96
5.2.110.1270.03011.00
5.2.100.1570.03011.01
5.2.90.1300.02711.01
5.2.80.1430.03710.96
5.2.70.1230.02711.11
5.2.60.1370.03310.89
5.2.50.1200.03010.88
5.2.40.1270.04010.93
5.2.30.1130.03710.82
5.2.20.1300.03711.00
5.2.10.1370.03010.71
5.2.00.1500.03310.79
5.1.60.1330.02710.08
5.1.50.1030.0309.88
5.1.40.1230.02310.10
5.1.30.1270.03010.40
5.1.20.1230.03310.51
5.1.10.1170.0239.99
5.1.00.0970.04010.05
5.0.50.0530.0238.47
5.0.40.0700.0208.33
5.0.30.0600.0308.34
5.0.20.0630.0338.27
5.0.10.0670.0308.21
5.0.00.0730.0478.16
4.4.90.0670.0277.83
4.4.80.0530.0207.83
4.4.70.0630.0207.83
4.4.60.0730.0207.83
4.4.50.0670.0277.83
4.4.40.0670.0337.83
4.4.30.0700.0207.83
4.4.20.0570.0207.83
4.4.10.0430.0207.83
4.4.00.0600.0437.83
4.3.110.0470.0177.83
4.3.100.0500.0137.83
4.3.90.0600.0207.83
4.3.80.0770.0337.83
4.3.70.0730.0177.83
4.3.60.0600.0237.83
4.3.50.0530.0137.83
4.3.40.0670.0407.83
4.3.30.0270.0137.83
4.3.20.0400.0207.83
4.3.10.0330.0177.83
4.3.00.0270.0137.83

preferences:
42.46 ms | 401 KiB | 5 Q