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 $result = preg_replace($regex, "(?<$1>$2)", $pattern); $result = strtr($result, $tokens); /*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.70.0130.00616.88
8.3.60.0090.00618.43
8.3.50.0090.01121.27
8.3.40.0080.00619.09
8.3.30.0100.00320.03
8.3.20.0050.00320.29
8.3.10.0050.00321.14
8.3.00.0080.00022.53
8.2.180.0180.00416.63
8.2.170.0120.00322.96
8.2.160.0070.00722.34
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0030.00626.16
8.2.120.0040.00420.94
8.2.110.0060.00319.45
8.2.100.0040.00817.84
8.2.90.0000.00719.22
8.2.80.0000.00818.03
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0080.00018.21
8.2.30.0000.00819.38
8.2.20.0000.00717.86
8.2.10.0040.00417.81
8.2.00.0000.00817.75
8.1.280.0030.01025.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0000.00923.79
8.1.230.0060.00621.03
8.1.220.0030.00518.77
8.1.210.0040.00419.09
8.1.200.0030.00617.35
8.1.190.0080.00017.39
8.1.180.0060.00318.10
8.1.170.0030.00618.71
8.1.160.0070.00018.75
8.1.150.0050.00218.59
8.1.140.0060.00317.53
8.1.130.0030.00317.89
8.1.120.0050.00217.42
8.1.110.0040.00417.43
8.1.100.0000.00717.43
8.1.90.0060.00317.55
8.1.80.0040.00417.58
8.1.70.0040.00417.43
8.1.60.0070.00317.64
8.1.50.0000.00817.50
8.1.40.0040.00417.56
8.1.30.0060.00317.69
8.1.20.0000.00817.72
8.1.10.0000.00717.65
8.1.00.0030.00517.55
8.0.300.0080.00419.73
8.0.290.0000.00717.04
8.0.280.0000.00718.38
8.0.270.0070.00017.12
8.0.260.0070.00016.99
8.0.250.0000.00716.97
8.0.240.0040.00417.10
8.0.230.0070.00016.93
8.0.220.0030.00517.01
8.0.210.0040.00416.88
8.0.200.0030.00316.98
8.0.190.0000.00717.04
8.0.180.0040.00416.98
8.0.170.0070.00016.87
8.0.160.0050.00316.94
8.0.150.0000.00716.81
8.0.140.0030.00716.89
8.0.130.0030.00313.37
8.0.120.0040.00416.93
8.0.110.0070.00017.00
8.0.100.0000.00716.86
8.0.90.0040.00416.95
8.0.80.0150.00316.96
8.0.70.0000.00716.88
8.0.60.0000.00716.79
8.0.50.0000.00717.00
8.0.30.0080.01117.49
8.0.20.0130.00817.40
8.0.10.0020.00516.86
8.0.00.0050.01516.85
7.4.330.0020.00216.77
7.4.320.0070.00016.65
7.4.300.0000.00616.63
7.4.290.0000.00716.65
7.4.280.0080.00016.73
7.4.270.0030.00316.73
7.4.260.0000.00613.53
7.4.250.0040.00416.70
7.4.240.0040.00316.70
7.4.230.0050.00216.64
7.4.220.0120.00716.85
7.4.210.0070.00816.70
7.4.200.0030.00316.57
7.4.190.0030.00316.90
7.4.160.0040.01116.54
7.4.150.0110.00717.40
7.4.140.0120.00517.86
7.4.130.0050.01216.66
7.4.120.0050.01516.49
7.4.110.0070.01016.66
7.4.100.0140.00416.64
7.4.90.0100.00716.67
7.4.80.0110.01419.39
7.4.70.0070.01116.86
7.4.60.0130.00316.53
7.4.50.0090.00016.77
7.4.40.0070.01122.77
7.4.30.0080.00816.66
7.4.00.0060.01115.05
7.3.330.0020.00213.20
7.3.320.0000.00513.12
7.3.310.0030.00316.23
7.3.300.0020.00516.16
7.3.290.0120.00316.26
7.3.280.0090.00816.28
7.3.270.0040.01517.40
7.3.260.0090.00918.24
7.3.250.0070.01316.55
7.3.240.0130.01016.32
7.3.230.0190.00016.70
7.3.210.0150.00416.73
7.3.200.0060.01219.39
7.3.190.0090.00616.54
7.3.180.0040.01116.34
7.3.170.0030.01316.44
7.3.160.0070.01016.47
7.3.120.0060.00914.99
7.3.110.0000.01614.96
7.3.100.0040.01114.83
7.3.90.0070.00414.48
7.3.80.0170.00015.13
7.3.70.0030.00814.80
7.3.60.0090.00914.71
7.3.50.0060.00614.79
7.3.40.0030.00614.66
7.3.30.0070.00714.58
7.3.20.0070.00716.84
7.3.10.0070.01016.75
7.3.00.0090.00316.86
7.2.330.0090.00916.86
7.2.320.0130.00716.66
7.2.310.0070.01416.58
7.2.300.0030.01316.67
7.2.290.0060.01116.89
7.2.250.0100.00915.33
7.2.240.0070.01015.15
7.2.230.0000.01415.09
7.2.220.0070.00715.04
7.2.210.0060.01015.30
7.2.200.0040.01115.25
7.2.190.0030.01215.07
7.2.180.0110.00415.20
7.2.170.0090.00615.06
7.2.00.0030.01019.19
7.1.330.0100.00316.00
7.1.320.0040.01115.79
7.1.310.0100.00615.70
7.1.300.0070.00716.07
7.1.290.0060.00315.70
7.1.280.0000.01015.94
7.1.270.0040.01116.06
7.1.260.0030.01015.72
7.1.100.0060.00617.95
7.1.70.0140.00517.04
7.1.60.0000.02419.17
7.1.50.0110.01117.22
7.1.00.0000.07722.38
7.0.200.0070.00016.63
7.0.140.0070.07022.07
7.0.60.0030.04019.86
7.0.50.0030.04017.89
7.0.40.0170.06720.32
7.0.30.0070.08720.11
7.0.20.0330.07720.22
7.0.10.0270.08320.14
7.0.00.0100.08020.34
5.6.280.0000.07720.98
5.6.210.0070.03720.56
5.6.200.0030.09018.11
5.6.190.0030.07720.63
5.6.180.0330.04320.77
5.6.170.0470.07720.38
5.6.160.0130.06020.51
5.6.150.0100.07318.33
5.6.140.0100.08018.18
5.6.130.0170.06318.20
5.6.120.0170.04021.02
5.6.110.0100.07721.01
5.6.100.0070.06720.97
5.6.90.0030.04321.00
5.6.80.0030.04020.37
5.6.70.4270.04320.38
5.5.350.0000.04020.43
5.5.340.0000.04017.91
5.5.330.0030.04020.15
5.5.320.2970.03720.27
5.5.310.0270.05020.32
5.5.300.0030.04018.00
5.5.290.0070.05717.94
5.5.280.0000.04320.76
5.5.270.0100.04020.74
5.5.260.0170.07320.64
5.5.250.0100.07320.61
5.5.240.0000.04020.23
5.4.450.0300.06719.23
5.4.440.0170.08019.54
5.4.430.0230.07019.57
5.4.420.0230.04719.40
5.4.410.0170.05019.28
5.4.400.0200.04018.93
5.4.390.0170.04718.81
5.4.380.0130.06018.80
5.4.370.0170.06019.16
5.4.360.0200.07319.24
5.4.350.0200.05019.15
5.4.340.0230.07319.10
5.4.320.0300.06318.94
5.4.310.0230.07019.10
5.4.300.0230.07319.09
5.4.290.0230.07019.08
5.4.280.0300.06319.08
5.4.270.0170.04018.93
5.4.260.0230.03319.07
5.4.250.0170.03718.79
5.4.240.0230.05019.19
5.4.230.0230.06019.06
5.4.220.0230.06719.08
5.4.210.0370.03718.80
5.4.200.0400.05019.24
5.4.190.0200.07019.06
5.4.180.0230.05719.05
5.4.170.0230.06019.13
5.4.160.0230.03319.06
5.4.150.0230.03319.11
5.4.140.0200.07016.24
5.4.130.0230.04016.59
5.4.120.0170.03716.23
5.4.110.0100.04716.19
5.4.100.0170.07716.48
5.4.90.0300.04316.46
5.4.80.0270.05016.29
5.4.70.0130.05316.46
5.4.60.0270.06316.20
5.4.50.0230.06016.45
5.4.40.0170.06316.24
5.4.30.0270.06016.40
5.4.20.0230.05716.37
5.4.10.0230.06016.05
5.4.00.0200.06715.73
5.3.290.0270.06714.51
5.3.280.0300.06314.44
5.3.270.0200.06014.59
5.3.260.0200.05314.64
5.3.250.0130.04014.56
5.3.240.0230.07314.44
5.3.230.0170.04014.54
5.3.220.0170.03714.43
5.3.210.0170.03714.55
5.3.200.0270.07014.52
5.3.190.0170.07714.41
5.3.180.0200.06014.61
5.3.170.0130.05714.61
5.3.160.0270.07014.41
5.3.150.0300.06714.43
5.3.140.0200.06314.40
5.3.130.0230.04014.40
5.3.120.0200.04014.39
5.3.110.0300.07014.39
5.3.100.0230.04713.88
5.3.90.0270.06013.86
5.3.80.0200.05313.86
5.3.70.0200.06713.85
5.3.60.0230.05014.09
5.3.50.0270.04313.79
5.3.40.0330.06313.93
5.3.30.0230.05713.81
5.3.20.0170.07313.56
5.3.10.0170.06713.70
5.3.00.0330.05713.48
5.2.170.0130.03012.59
5.2.160.0300.05012.59
5.2.150.0170.04712.59
5.2.140.0170.06012.59
5.2.130.0230.05712.59
5.2.120.0070.03712.59
5.2.110.0230.05312.59
5.2.100.0230.03312.59
5.2.90.0200.05712.59
5.2.80.0100.06712.59
5.2.70.0200.05712.59
5.2.60.0230.05712.59
5.2.50.0170.06312.59
5.2.40.0230.04712.59
5.2.30.0200.05312.59
5.2.20.0170.06012.59
5.2.10.0170.06012.59
5.2.00.0200.05712.59
5.1.60.0130.05012.59
5.1.50.0200.02712.59
5.1.40.0100.05312.59
5.1.30.0200.03012.59
5.1.20.0270.03012.59
5.1.10.0200.04312.59
5.1.00.0130.05712.59
5.0.50.0100.03312.59
5.0.40.0170.02012.59
5.0.30.0200.05012.59
5.0.20.0130.02012.59
5.0.10.0100.03312.59
5.0.00.0100.06012.59
4.4.90.0100.03312.59
4.4.80.0100.02012.59
4.4.70.0030.03012.59
4.4.60.0100.02312.59
4.4.50.0170.02312.59
4.4.40.0130.02712.59
4.4.30.0100.01712.59
4.4.20.0070.03712.59
4.4.10.0070.03712.59
4.4.00.0030.03012.59
4.3.110.0070.02012.59
4.3.100.0100.03012.59
4.3.90.0070.01312.59
4.3.80.0070.05312.59
4.3.70.0070.02012.59
4.3.60.0030.02312.59
4.3.50.0030.01712.59
4.3.40.0030.02712.59
4.3.30.0000.01712.59
4.3.20.0030.03712.59
4.3.10.0000.03712.59
4.3.00.0000.02712.59

preferences:
31.83 ms | 401 KiB | 5 Q