3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tagify($str, $baseUrl = '/board/') { $baseUrl = rtrim($baseUrl, '/'); return preg_replace('/ (?!<a[^<>]*>[^\#]*) # Dont match if there is an opening <a> tag and any chars after it. \#([-_\w]+\b) # Match the hashtag. (?![^<]*<\\/a>) # Ignore any anding <\/a> tag including any chars before it not in hashtag. /ix', '<a href="'.$baseUrl.'/$1">#$1</a>', $str); } $str = <<<STR This is <a href="http://foo.com">This is #foo</a>. Simple #html-stuff text <a href="http://foobar.com#baz">#simple</a> <span class="simple">simple #simple text text</span> STR; echo tagify($str);

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.0040.01116.50
8.3.50.0110.00517.51
8.3.40.0070.00718.92
8.3.30.0030.01318.97
8.3.20.0040.00418.86
8.3.10.0030.00520.80
8.3.00.0000.00919.49
8.2.180.0090.00618.41
8.2.170.0070.00722.96
8.2.160.0120.00321.19
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.61
8.2.110.0050.00521.15
8.2.100.0040.00817.91
8.2.90.0040.00719.48
8.2.80.0070.00019.46
8.2.70.0080.00017.63
8.2.60.0090.00318.03
8.2.50.0060.00318.07
8.2.40.0000.00718.28
8.2.30.0080.00018.08
8.2.20.0070.00017.86
8.2.10.0040.00417.96
8.2.00.0000.00817.96
8.1.280.0070.01025.92
8.1.270.0000.00724.66
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0060.00322.47
8.1.230.0110.00021.04
8.1.220.0030.00517.74
8.1.210.0080.00018.89
8.1.200.0030.00617.36
8.1.190.0040.00417.51
8.1.180.0040.00418.10
8.1.170.0080.00018.84
8.1.160.0040.00418.84
8.1.150.0000.00718.70
8.1.140.0040.00417.51
8.1.130.0070.00017.86
8.1.120.0080.00017.52
8.1.110.0020.00517.49
8.1.100.0000.00717.54
8.1.90.0040.00417.68
8.1.80.0000.00717.51
8.1.70.0000.00717.58
8.1.60.0030.01017.80
8.1.50.0000.00917.60
8.1.40.0060.00317.69
8.1.30.0060.00317.80
8.1.20.0040.00417.85
8.1.10.0030.00617.69
8.1.00.0040.00417.61
8.0.300.0000.00719.90
8.0.290.0040.00416.88
8.0.280.0030.00518.39
8.0.270.0000.00717.24
8.0.260.0000.00716.91
8.0.250.0000.00717.06
8.0.240.0070.00317.23
8.0.230.0000.00717.09
8.0.220.0000.00717.18
8.0.210.0000.00716.98
8.0.200.0000.00617.12
8.0.190.0040.00417.15
8.0.180.0000.00817.00
8.0.170.0000.00817.07
8.0.160.0000.00717.09
8.0.150.0050.00317.05
8.0.140.0040.00416.95
8.0.130.0030.00313.51
8.0.120.0080.00017.07
8.0.110.0070.00017.13
8.0.100.0070.00016.95
8.0.90.0050.00217.05
8.0.80.0090.00617.16
8.0.70.0070.00016.99
8.0.60.0030.00516.84
8.0.50.0040.00416.92
8.0.30.0120.00917.32
8.0.20.0190.01617.33
8.0.10.0020.00517.08
8.0.00.0130.00816.80
7.4.330.0000.00513.13
7.4.320.0040.00316.58
7.4.300.0000.00716.61
7.4.290.0030.00316.86
7.4.280.0000.00916.71
7.4.270.0030.00316.80
7.4.260.0050.00013.56
7.4.250.0000.00916.70
7.4.240.0030.00516.81
7.4.230.0040.00416.80
7.4.220.0100.01416.64
7.4.210.0100.00616.76
7.4.200.0050.00216.71
7.4.190.0040.00416.87
7.4.160.0090.00616.80
7.4.150.0030.01316.53
7.4.140.0120.00816.78
7.4.130.0090.00816.71
7.4.120.0080.01016.68
7.4.110.0060.01016.73
7.4.100.0110.00816.81
7.4.90.0130.01016.81
7.4.80.0100.01319.39
7.4.70.0070.01016.70
7.4.60.0080.01216.60
7.4.50.0030.00616.83
7.4.40.0040.00916.63
7.4.30.0090.00916.71
7.4.00.0110.00415.29
7.3.330.0060.00013.53
7.3.320.0000.00513.49
7.3.310.0000.00916.55
7.3.300.0030.00316.48
7.3.290.0100.00516.57
7.3.280.0070.00916.52
7.3.270.0030.01716.64
7.3.260.0150.00316.71
7.3.250.0110.00716.73
7.3.240.0090.01416.56
7.3.230.0080.00816.70
7.3.210.0180.00316.76
7.3.200.0110.00616.53
7.3.190.0070.01816.70
7.3.180.0060.01016.58
7.3.170.0090.00916.82
7.3.160.0100.00716.61
7.3.120.0100.00715.26
7.2.330.0130.00316.88
7.2.320.0130.01016.93
7.2.310.0160.00816.86
7.2.300.0090.01316.83
7.2.290.0110.00716.88
7.2.60.0070.00717.13
7.2.00.0000.01519.69
7.1.200.0030.01015.95
7.1.100.0100.00718.22
7.1.70.0040.01216.94
7.1.60.0060.01319.40
7.1.50.0030.01217.17
7.1.00.0070.06322.33
7.0.200.0090.00615.21
7.0.140.0030.07321.99
7.0.120.0000.06722.14
7.0.60.0070.03719.93
7.0.50.0100.07717.74
7.0.40.0130.06717.88
7.0.30.0070.04017.75
7.0.20.0030.08717.77
7.0.10.0030.05317.76
7.0.00.0100.04717.82
5.6.210.0070.03720.74
5.6.200.0100.07318.29
5.6.190.0030.08718.21
5.6.180.0130.07718.21
5.6.170.0070.07018.14
5.6.160.0070.08018.16
5.6.150.0130.07018.15
5.6.140.0100.06318.24
5.6.130.0100.04718.28
5.6.120.0070.08018.20
5.6.110.0000.07018.22
5.6.100.0100.07718.15
5.6.90.0030.06318.23
5.6.80.0030.08317.58
5.6.70.0000.06317.66
5.6.60.0000.06317.53
5.6.50.0070.04317.61
5.6.40.0030.04017.64
5.6.30.0030.05317.54
5.6.20.0100.07317.51
5.6.10.0070.07717.57
5.6.00.0070.06717.52
5.5.350.0200.08020.41
5.5.340.0000.06318.09
5.5.330.0130.06717.95
5.5.320.0130.04017.95
5.5.310.0070.08017.95
5.5.300.0070.05717.97
5.5.290.0070.07318.08
5.5.280.0000.05717.95
5.5.270.0070.07317.95
5.5.260.0000.05317.95
5.5.250.0030.05017.86
5.5.240.0070.06317.34
5.5.230.0100.07717.34
5.5.220.0070.04717.45
5.5.210.0000.05017.34
5.5.200.0030.04017.31
5.5.190.0030.08017.33
5.5.180.0070.03717.31
5.5.160.0070.07317.30
5.5.150.0130.06317.43
5.5.140.0100.05317.38
5.5.130.0170.06717.41
5.5.120.0070.08017.34
5.5.110.0100.07317.28
5.5.100.0030.08317.18
5.5.90.0070.07717.20
5.5.80.0030.07317.29
5.5.70.0100.06317.27
5.5.60.0100.06317.20
5.5.50.0170.06717.19
5.5.40.0030.07717.23
5.5.30.0070.08017.30
5.5.20.0030.07317.19
5.5.10.0030.05017.19
5.5.00.0130.04717.19
5.4.450.0070.07019.31
5.4.440.0070.07719.38
5.4.430.0070.04719.44
5.4.420.0000.07319.27
5.4.410.0030.05319.29
5.4.400.0100.03718.89
5.4.390.0030.08019.12
5.4.380.0070.08019.06
5.4.370.0070.07719.09
5.4.360.0070.06719.05
5.4.350.0100.04019.05
5.4.340.0070.08019.12
5.4.320.0070.05719.09
5.4.310.0230.06019.13
5.4.300.0130.07019.08
5.4.290.0030.08019.04
5.4.280.0170.07019.05
5.4.270.0030.06719.14
5.4.260.0100.08019.05
5.4.250.0170.06719.02
5.4.240.0070.08019.09
5.4.230.0070.07719.26
5.4.220.0130.07019.12
5.4.210.0070.07318.95
5.4.200.0130.03719.04
5.4.190.0030.08018.98
5.4.180.0070.08019.04
5.4.170.0070.07719.08
5.4.160.0100.04018.87
5.4.150.0100.07719.08
5.4.140.0070.08016.46
5.4.130.0070.04716.47
5.4.120.0100.06716.54
5.4.110.0100.04316.36
5.4.100.0000.08316.48
5.4.90.0100.07016.40
5.4.80.0000.07716.46
5.4.70.0070.07316.37
5.4.60.0070.06716.29
5.4.50.0070.06316.35
5.4.40.0070.07316.49
5.4.30.0100.06716.28
5.4.20.0030.07716.53
5.4.10.0130.06016.38
5.4.00.0100.07015.87
5.3.290.0030.04714.77
5.3.280.0030.08314.45
5.3.270.0070.07714.65
5.3.260.0100.05014.65
5.3.250.0070.07314.61
5.3.240.0200.03314.47
5.3.230.0030.06714.82
5.3.220.0170.05714.56
5.3.210.0070.04714.64
5.3.200.0030.07314.42
5.3.190.0030.08314.79
5.3.180.0100.05014.41
5.3.170.0030.08014.53
5.3.160.0170.06314.58
5.3.150.0070.07314.55
5.3.140.0030.08014.65
5.3.130.0170.06314.54
5.3.120.0100.07314.57
5.3.110.0000.06714.56
5.3.100.0170.06314.04
5.3.90.0030.04014.05
5.3.80.0070.07714.04
5.3.70.0070.05314.07
5.3.60.0030.06714.00
5.3.50.0100.07013.97
5.3.40.0100.06714.00
5.3.30.0100.06313.91
5.3.20.0000.07313.54
5.3.10.0030.05013.49
5.3.00.0070.07313.72
5.2.170.0030.06311.17
5.2.160.0030.06711.20
5.2.150.0030.06711.19
5.2.140.0070.04711.19
5.2.130.0070.06011.09
5.2.120.0030.04011.15
5.2.110.0100.06011.00
5.2.100.0100.05010.99
5.2.90.0000.06311.06
5.2.80.0000.05311.30
5.2.70.0030.06311.09
5.2.60.0100.05711.09
5.2.50.0070.05011.09
5.2.40.0030.03011.07
5.2.30.0100.03310.83
5.2.20.0000.03711.07
5.2.10.0030.05010.89
5.2.00.0030.06310.77
5.1.60.0000.0539.84
5.1.50.0000.04010.06
5.1.40.0000.03310.06
5.1.30.0030.05710.38
5.1.20.0070.05010.43
5.1.10.0130.04710.07
5.1.00.0070.04710.15
5.0.50.0030.0508.60
5.0.40.0000.0438.27
5.0.30.0000.0638.33
5.0.20.0100.0338.30
5.0.10.0000.0238.27
5.0.00.0030.0678.27
4.4.90.0030.0238.27
4.4.80.0000.0408.27
4.4.70.0000.0278.27
4.4.60.0000.0378.27
4.4.50.0000.0378.27
4.4.40.0100.0438.27
4.4.30.0000.0278.27
4.4.20.0000.0378.27
4.4.10.0000.0378.27
4.4.00.0030.0538.27
4.3.110.0000.0378.27
4.3.100.0030.0338.27
4.3.90.0000.0238.27
4.3.80.0000.0578.27
4.3.70.0100.0278.27
4.3.60.0000.0308.27
4.3.50.0000.0408.27
4.3.40.0030.0378.27
4.3.30.0000.0378.27
4.3.20.0030.0238.27
4.3.10.0000.0338.27
4.3.00.0000.0378.27

preferences:
40.22 ms | 401 KiB | 5 Q