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.70.0180.00018.68
8.3.60.0110.00316.50
8.3.50.0070.00817.32
8.3.40.0110.00318.71
8.3.30.0040.01118.50
8.3.20.0040.00418.65
8.3.10.0030.00620.33
8.3.00.0040.00419.38
8.2.180.0120.00916.88
8.2.170.0140.00722.96
8.2.160.0070.00720.58
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.48
8.2.110.0090.00022.22
8.2.100.0100.00017.91
8.2.90.0040.00419.09
8.2.80.0040.00417.97
8.2.70.0100.00017.63
8.2.60.0030.00517.80
8.2.50.0000.00818.07
8.2.40.0000.00718.16
8.2.30.0060.00618.06
8.2.20.0040.00417.56
8.2.10.0040.00417.81
8.2.00.0080.00317.72
8.1.280.0120.00325.92
8.1.270.0000.00724.66
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0000.00917.79
8.1.230.0080.00317.52
8.1.220.0000.00817.75
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0060.00317.10
8.1.180.0040.00418.10
8.1.170.0040.00418.90
8.1.160.0030.00318.93
8.1.150.0000.00718.55
8.1.140.0040.00417.46
8.1.130.0000.00717.83
8.1.120.0000.00817.46
8.1.110.0040.00417.34
8.1.100.0000.00717.50
8.1.90.0000.00817.43
8.1.80.0020.00517.43
8.1.70.0030.00317.45
8.1.60.0000.00717.58
8.1.50.0000.00917.48
8.1.40.0000.00717.35
8.1.30.0040.00417.54
8.1.20.0070.00017.54
8.1.10.0040.00417.55
8.1.00.0040.00417.39
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.33
8.0.270.0030.00317.26
8.0.260.0070.00016.80
8.0.250.0000.00816.92
8.0.240.0040.00416.91
8.0.230.0000.00717.04
8.0.220.0000.00716.82
8.0.210.0000.00816.92
8.0.200.0000.00616.91
8.0.190.0080.00017.02
8.0.180.0000.00816.98
8.0.170.0040.00417.02
8.0.160.0000.00716.89
8.0.150.0060.00316.89
8.0.140.0040.00416.87
8.0.130.0000.00513.36
8.0.120.0050.00316.97
8.0.110.0000.00716.79
8.0.100.0050.00316.95
8.0.90.0040.00416.77
8.0.80.0040.01116.89
8.0.70.0020.00516.96
8.0.60.0000.00816.95
8.0.50.0030.00516.71
8.0.30.0090.00917.22
8.0.20.0090.00916.97
8.0.10.0000.00716.88
8.0.00.0130.01216.77
7.4.330.0020.00312.89
7.4.320.0020.00516.34
7.4.300.0040.00416.61
7.4.290.0070.00016.55
7.4.280.0080.00016.59
7.4.270.0030.00316.52
7.4.260.0000.00513.39
7.4.250.0040.00416.48
7.4.240.0000.00716.64
7.4.230.0030.00316.40
7.4.220.0060.01316.67
7.4.210.0090.00616.59
7.4.200.0000.00716.61
7.4.190.0030.00316.45
7.4.160.0060.00916.54
7.4.150.0070.01016.45
7.4.140.0080.01016.56
7.4.130.0120.00616.62
7.4.120.0120.00516.46
7.4.110.0040.01216.67
7.4.100.0160.00716.52
7.4.90.0140.01016.65
7.4.80.0090.00919.39
7.4.70.0100.00616.43
7.4.60.0060.01116.47
7.4.50.0060.00316.74
7.4.40.0000.01716.45
7.4.30.0070.01016.73
7.4.00.0090.00815.13
7.3.330.0060.00013.29
7.3.320.0030.00213.32
7.3.310.0070.00016.39
7.3.300.0050.00216.36
7.3.290.0140.00016.34
7.3.280.0050.01216.33
7.3.270.0120.01216.41
7.3.260.0090.00916.39
7.3.250.0130.00416.59
7.3.240.0130.00316.37
7.3.230.0170.00016.61
7.3.210.0080.01116.42
7.3.200.0090.00616.48
7.3.190.0170.00716.57
7.3.180.0110.00716.30
7.3.170.0120.00916.38
7.3.160.0070.01116.42
7.3.120.0090.00714.94
7.3.110.0090.00614.89
7.3.100.0070.00714.71
7.3.90.0130.00314.93
7.3.80.0100.00314.98
7.3.70.0080.00814.91
7.3.60.0030.01414.77
7.3.50.0060.00614.85
7.3.40.0040.01114.84
7.3.30.0110.00414.74
7.3.20.0100.00716.71
7.3.10.0060.00516.80
7.3.00.0070.00716.66
7.2.330.0110.01116.78
7.2.320.0070.01416.51
7.2.310.0130.00616.66
7.2.300.0090.01316.71
7.2.290.0130.00316.47
7.2.250.0090.00914.92
7.2.240.0130.00314.83
7.2.230.0070.01014.97
7.2.220.0030.00614.96
7.2.210.0060.00914.91
7.2.200.0030.00615.03
7.2.190.0040.01215.13
7.2.180.0100.00715.00
7.2.170.0100.00314.80
7.2.130.0050.01016.89
7.2.120.0050.00716.93
7.2.110.0060.00716.71
7.2.100.0070.00816.95
7.2.90.0020.01116.73
7.2.80.0060.00316.83
7.2.70.0080.00617.06
7.2.60.0050.00916.90
7.2.50.0060.00916.81
7.2.40.0040.01016.90
7.2.30.0070.00316.90
7.2.20.0080.00616.66
7.2.10.0070.00616.82
7.2.00.0030.01117.67
7.1.330.0060.00915.84
7.1.320.0030.01115.91
7.1.310.0030.00615.57
7.1.300.0040.01015.77
7.1.290.0030.00615.76
7.1.280.0130.00315.90
7.1.270.0030.01015.65
7.1.260.0030.00615.77
7.1.250.0060.00515.92
7.1.240.0090.00015.44
7.1.230.0080.00415.64
7.1.220.0030.00915.48
7.1.210.0060.00615.70
7.1.200.0030.00915.65
7.1.190.0060.00315.50
7.1.180.0060.00615.71
7.1.170.0100.00315.49
7.1.160.0040.00715.97
7.1.150.0040.00715.60
7.1.140.0070.00715.82
7.1.130.0030.00715.78
7.1.120.0060.00915.57
7.1.110.0030.01015.46
7.1.100.0060.00315.83
7.1.90.0040.00415.91
7.1.80.0000.01115.95
7.1.70.0000.01216.53
7.1.60.0100.00717.69
7.1.50.0140.01125.36
7.1.40.0100.00315.46
7.1.30.0060.00615.75
7.1.20.0030.01015.71
7.1.10.0060.00615.77
7.1.00.0030.04318.92
7.0.330.0070.00315.34
7.0.320.0090.00615.44
7.0.310.0040.00415.57
7.0.300.0060.00615.44
7.0.290.0060.00615.34
7.0.280.0060.00615.30
7.0.270.0070.00715.42
7.0.260.0000.00915.51
7.0.250.0040.00415.45
7.0.240.0070.00715.36
7.0.230.0050.00515.49
7.0.220.0000.01215.32
7.0.210.0000.01415.22
7.0.200.0270.00515.14
7.0.190.0080.00415.37
7.0.180.0060.00615.26
7.0.170.0060.00315.55
7.0.160.0030.01015.38
7.0.150.0030.00615.60
7.0.140.0090.03718.71
7.0.130.0000.00715.59
7.0.120.0090.03118.71
7.0.110.0080.00415.16
7.0.100.0050.00315.11
7.0.90.0090.00615.46
7.0.80.0070.00715.54
7.0.70.0030.00615.52
7.0.60.0080.03717.70
7.0.50.0090.02916.70
7.0.40.0080.02515.65
7.0.30.0030.02715.48
7.0.20.0030.02515.72
7.0.10.0010.02415.71
7.0.00.0070.02715.70
5.6.380.0060.00614.49
5.6.370.0070.00313.91
5.6.360.0000.01414.52
5.6.350.0100.00314.25
5.6.340.0040.00414.46
5.6.330.0030.00914.42
5.6.320.0070.00314.45
5.6.310.0030.00714.22
5.6.300.0050.00514.48
5.6.290.0030.00614.37
5.6.280.0100.03517.84
5.6.270.0060.01014.43
5.6.260.0000.01014.58
5.6.250.0090.00314.15
5.6.240.0040.00814.40
5.6.230.0090.00914.24
5.6.220.0060.00614.27
5.6.210.0050.05017.49
5.6.200.0090.03216.09
5.6.190.0120.04016.18
5.6.180.0080.02216.40
5.6.170.0030.02516.34
5.6.160.0040.02716.16
5.6.150.0060.02316.25
5.6.140.0040.02116.23
5.6.130.0080.01916.27
5.6.120.0030.03016.31
5.6.110.0050.02416.30
5.6.100.0060.02316.30
5.6.90.0080.02116.16
5.6.80.0100.01715.80
5.6.70.0050.02215.94
5.6.60.0050.02415.88
5.6.50.0090.02215.89
5.6.40.0070.04415.86
5.6.30.0040.02215.97
5.6.20.0080.02315.90
5.6.10.0090.01715.88
5.6.00.0070.02015.92
5.5.380.0040.00411.18
5.5.370.0000.00911.18
5.5.360.0060.00611.18
5.5.350.0130.03315.86
5.5.340.0090.03714.60
5.5.330.0100.03514.55
5.5.320.0050.02214.63
5.5.310.0030.02114.63
5.5.300.0030.02214.59
5.5.290.0020.02514.57
5.5.280.0050.02214.58
5.5.270.0050.02014.54
5.5.260.0030.02214.66
5.5.250.0020.02214.51
5.5.240.0070.01814.27
5.5.230.0030.02414.26
5.5.220.0030.02314.34
5.5.210.0020.02114.29
5.5.200.0060.02014.27
5.5.190.0030.02114.24
5.5.180.0070.01714.24
5.5.170.0000.01411.18
5.5.160.0060.04414.25
5.5.150.0020.02714.22
5.5.140.0030.02514.23
5.5.130.0020.04414.23
5.5.120.0050.03314.24
5.5.110.0050.04414.25
5.5.100.0080.01814.21
5.5.90.0030.04514.20
5.5.80.0060.04314.20
5.5.70.0040.02714.18
5.5.60.0050.02914.24
5.5.50.0050.04014.17
5.5.40.0060.04014.23
5.5.30.0090.03714.25
5.5.20.0020.04814.21
5.5.10.0070.03314.21
5.5.00.0100.03814.21
5.4.450.0050.02115.30
5.4.440.0040.02315.27
5.4.430.0050.02115.30
5.4.420.0080.01815.25
5.4.410.0050.01815.24
5.4.400.0060.02015.10
5.4.390.0040.02115.08
5.4.380.0020.02115.12
5.4.370.0020.02715.15
5.4.360.0040.02015.20
5.4.350.0010.02915.25
5.4.340.0030.02015.15
5.4.330.0030.00611.18
5.4.320.0050.03215.09
5.4.310.0080.03215.10
5.4.300.0100.02215.10
5.4.290.0020.04515.08
5.4.280.0050.04015.11
5.4.270.0070.03215.06
5.4.260.0110.02215.10
5.4.250.0100.03915.11
5.4.240.0040.03115.03
5.4.230.0050.04015.09
5.4.220.0020.02515.10
5.4.210.0060.04015.22
5.4.200.0020.03215.11
5.4.190.0050.04415.14
5.4.180.0070.03715.13
5.4.170.0070.04115.10
5.4.160.0050.02515.14
5.4.150.0030.04515.14
5.4.140.0040.04013.79
5.4.130.0030.02913.74
5.4.120.0050.02613.86
5.4.110.0090.03713.88
5.4.100.0070.03713.79
5.4.90.0070.01813.83
5.4.80.0030.03813.80
5.4.70.0030.03513.70
5.4.60.0050.03813.75
5.4.50.0050.03813.81
5.4.40.0020.03413.82
5.4.30.0020.02413.84
5.4.20.0100.03713.70
5.4.10.0050.03413.76
5.4.00.0110.02213.47
5.3.290.0060.04012.90
5.3.280.0030.03312.81
5.3.270.0050.03812.82
5.3.260.0080.03812.90
5.3.250.0080.04012.87
5.3.240.0070.03712.91
5.3.230.0110.03312.88
5.3.220.0070.02712.90
5.3.210.0030.03012.91
5.3.200.0030.03012.87
5.3.190.0070.03012.98
5.3.180.0040.04212.87
5.3.170.0080.02112.89
5.3.160.0030.02712.90
5.3.150.0050.03712.79
5.3.140.0030.03612.90
5.3.130.0060.03312.89
5.3.120.0030.04212.86
5.3.110.0060.03812.87
5.3.100.0070.04212.58
5.3.90.0050.02212.61
5.3.80.0080.03912.62
5.3.70.0050.04612.60
5.3.60.0120.03312.62
5.3.50.0030.04012.51
5.3.40.0030.04312.58
5.3.30.0030.03712.56
5.3.20.0070.03712.36
5.3.10.0050.02012.45
5.3.00.0050.03212.42
5.2.170.0030.02011.19
5.2.160.0080.01811.17
5.2.150.0030.02911.18
5.2.140.0000.03711.18
5.2.130.0100.01211.14
5.2.120.0000.01911.24
5.2.110.0020.01711.09
5.2.100.0050.02811.15
5.2.90.0020.03711.14
5.2.80.0030.03511.08
5.2.70.0040.01911.13
5.2.60.0120.02611.12
5.2.50.0050.03211.11
5.2.40.0060.02411.08
5.2.30.0060.03111.08
5.2.20.0030.03611.07
5.2.10.0030.03311.03
5.2.00.0050.03010.97
5.1.60.0020.03110.57
5.1.50.0030.02210.58
5.1.40.0020.01710.58
5.1.30.0030.01910.74
5.1.20.0020.03110.80
5.1.10.0030.01510.68
5.1.00.0080.02510.61
5.0.50.0020.0299.84
5.0.40.0020.0279.81
5.0.30.0070.0309.68
5.0.20.0020.0189.68
5.0.10.0020.0289.67
5.0.00.0030.0339.66
4.4.90.0040.0109.51
4.4.80.0020.0179.51
4.4.70.0030.0179.51
4.4.60.0030.0219.51
4.4.50.0050.0189.51
4.4.40.0020.0189.51
4.4.30.0030.0109.51
4.4.20.0030.0139.51
4.4.10.0070.0109.51
4.4.00.0030.0239.51
4.3.110.0010.0199.51
4.3.100.0030.0179.51
4.3.90.0050.0189.51
4.3.80.0030.0249.51
4.3.70.0030.0199.51
4.3.60.0030.0139.51
4.3.50.0020.0229.51
4.3.40.0040.0199.51
4.3.30.0020.0089.51
4.3.20.0030.0199.51
4.3.10.0030.0189.51
4.3.00.0030.0089.51

preferences:
54.21 ms | 401 KiB | 5 Q