3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "This is a #hashtag within some #awesometext."; function tagIt($body) { $string = $body; $htag = "#"; $newstring = preg_replace("/#(\w)+/g", "<a href='category.php?tag=$1'>#$1</a>", $string); //$arr = preg_split("/\s|\./", $string);print_r($arr); /*$arrc = count($arr); $i = 0; while($i < $arrc) { if(substr($arr[$i], 0, 1) === $htag) { $arr[$i] = "<a href = 'category.php?tag=".substr($arr[$i], 1)."'>".$arr[$i]."</a>"; } $i++; } $string = implode(" ", $arr);*/ echo "\n".$newstring."\n"; } tagIt($text);

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.0140.00718.25
8.3.50.0080.00922.05
8.3.40.0070.00718.77
8.3.30.0100.00319.09
8.3.20.0040.00420.35
8.3.10.0040.00422.05
8.3.00.0070.00022.39
8.2.180.0070.01416.63
8.2.170.0060.01222.96
8.2.160.0130.00722.11
8.2.150.0060.00324.18
8.2.140.0090.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00017.75
8.2.110.0090.00920.91
8.2.100.0110.00018.22
8.2.90.0040.00419.00
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0060.00617.92
8.2.50.0000.00818.22
8.2.40.0000.00720.55
8.2.30.0000.00719.23
8.2.20.0000.00817.64
8.2.10.0040.00417.79
8.2.00.0040.00417.72
8.1.280.0170.00325.92
8.1.270.0090.00022.08
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00322.65
8.1.230.0060.00620.32
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0050.00317.23
8.1.180.0030.00518.10
8.1.170.0040.00418.64
8.1.160.0000.00718.79
8.1.150.0000.00720.20
8.1.140.0000.00817.35
8.1.130.0000.00717.81
8.1.120.0050.00217.48
8.1.110.0000.00717.48
8.1.100.0080.00017.35
8.1.90.0030.00517.39
8.1.80.0000.00717.33
8.1.70.0000.00717.43
8.1.60.0040.00417.59
8.1.50.0060.00317.47
8.1.40.0040.00417.52
8.1.30.0000.00817.64
8.1.20.0080.00017.64
8.1.10.0070.00017.41
8.1.00.0040.00417.35
8.0.300.0000.00719.09
8.0.290.0070.00016.88
8.0.280.0000.00718.43
8.0.270.0000.00717.29
8.0.260.0030.00516.78
8.0.250.0030.00316.98
8.0.240.0000.00716.96
8.0.230.0030.00316.89
8.0.220.0070.00016.95
8.0.210.0000.00716.94
8.0.200.0000.00716.92
8.0.190.0040.00416.91
8.0.180.0000.00716.98
8.0.170.0080.00016.98
8.0.160.0040.00417.01
8.0.150.0000.00816.91
8.0.140.0040.00416.79
8.0.130.0030.00313.36
8.0.120.0080.00016.96
8.0.110.0080.00016.79
8.0.100.0040.00416.91
8.0.90.0040.00416.94
8.0.80.0090.00616.86
8.0.70.0000.00716.79
8.0.60.0080.00016.82
8.0.50.0040.00416.95
8.0.30.0100.01417.04
8.0.20.0070.01017.40
8.0.10.0000.00717.05
8.0.00.0090.01016.75
7.4.330.0060.00015.00
7.4.320.0060.00016.52
7.4.300.0030.00316.64
7.4.290.0000.00716.61
7.4.280.0080.00016.61
7.4.270.0070.00016.40
7.4.260.0070.00316.46
7.4.250.0070.00016.45
7.4.240.0020.00616.44
7.4.230.0000.00716.58
7.4.220.0140.01116.63
7.4.210.0090.00516.54
7.4.200.0000.00816.42
7.4.190.0000.00816.35
7.4.160.0090.01216.66
7.4.150.0090.00917.40
7.4.140.0090.01017.86
7.4.130.0110.02416.61
7.4.120.0080.00916.58
7.4.110.0100.00716.44
7.4.100.0140.00316.54
7.4.90.0100.00716.52
7.4.80.0140.00419.39
7.4.70.0070.01016.52
7.4.60.0120.00616.53
7.4.50.0060.00316.65
7.4.40.0130.00322.77
7.4.30.0130.00316.63
7.4.00.0060.00314.70
7.3.330.0030.00313.28
7.3.320.0020.00213.22
7.3.310.0060.00016.31
7.3.300.0070.00016.46
7.3.290.0000.01416.43
7.3.280.0070.01016.39
7.3.270.0060.01317.40
7.3.260.0110.00716.32
7.3.250.0120.00916.43
7.3.240.0100.01316.63
7.3.230.0150.00616.49
7.3.210.0130.00716.49
7.3.200.0080.01219.39
7.3.190.0070.01016.40
7.3.180.0060.00916.46
7.3.170.0150.00616.41
7.3.160.0030.01516.46
7.3.120.0090.00614.86
7.2.330.0120.00616.72
7.2.320.0120.01316.39
7.2.310.0070.01016.64
7.2.300.0090.00916.40
7.2.290.0110.01116.57
7.2.60.0060.00617.02
7.1.200.0030.01015.46
7.1.70.0000.01016.89
7.1.60.0000.01117.06
7.1.50.0030.01316.89
7.1.00.0070.07322.57
7.0.200.0070.00716.74
7.0.140.0100.06322.04
7.0.60.0100.07320.02
7.0.50.0070.08017.96
7.0.40.0170.07320.03
7.0.30.0430.06320.09
7.0.20.0370.08320.09
7.0.10.0070.07720.16
7.0.00.0170.08320.14
5.6.280.0030.07321.10
5.6.210.0030.08720.73
5.6.200.0070.08718.12
5.6.190.0170.04720.61
5.6.180.4200.04020.55
5.6.170.0330.05020.54
5.6.160.0070.08320.52
5.6.150.0070.08018.14
5.6.140.0030.05018.18
5.6.130.0030.05018.18
5.6.120.0030.04020.99
5.6.110.0130.05021.09
5.6.100.0030.08320.89
5.6.90.0100.03721.02
5.6.80.0130.06720.38
5.6.70.4130.03720.29
5.5.350.0100.03720.45
5.5.340.0070.07717.97
5.5.330.0030.05320.46
5.5.320.3100.04320.27
5.5.310.0270.07720.27
5.5.300.0000.09017.91
5.5.290.0030.08017.95
5.5.280.0230.06720.80
5.5.270.0200.07020.66
5.5.260.0000.04720.77
5.5.250.0070.07720.69
5.5.240.0170.07020.26
5.4.450.0470.04319.58
5.4.440.0570.05719.39
5.4.430.0100.07019.62
5.4.420.0070.06019.53
5.4.410.0070.06019.52
5.4.400.0130.06318.80
5.4.390.0100.05318.46
5.4.380.0130.06318.75
5.4.370.0170.04718.58
5.4.360.0200.04718.56
5.4.350.0170.05318.63
5.4.340.0130.05318.75
5.4.320.0050.04012.51
5.4.310.0010.04212.50
5.4.300.0060.04012.50
5.4.290.0060.04612.50
5.4.280.0060.04012.40
5.4.270.0130.06018.88
5.4.260.0100.06019.00
5.4.250.0100.05718.95
5.4.240.0200.05719.00
5.4.230.0230.07018.92
5.4.220.0170.05719.17
5.4.210.0100.05719.07
5.4.200.0200.07018.84
5.4.190.0100.06319.00
5.4.180.0100.05019.00
5.4.170.0130.07018.91
5.4.160.0100.06318.85
5.4.150.0170.04719.00
5.4.140.0030.07316.41
5.4.130.0100.06316.69
5.4.120.0070.05316.69
5.4.110.0100.05016.64
5.4.100.0130.05316.71
5.4.90.0070.05016.68
5.4.80.0130.05316.41
5.4.70.0130.05316.61
5.4.60.0200.06316.68
5.4.50.0100.06016.40
5.4.40.0100.06016.70
5.4.30.0100.06716.64
5.4.20.0200.04316.68
5.4.10.0100.05316.64
5.4.00.0070.05316.11
5.3.290.0060.04012.80
5.3.280.0170.05014.77
5.3.270.0100.07314.66
5.3.260.0100.05014.66
5.3.250.0100.04714.60
5.3.240.0100.05314.48
5.3.230.0130.05714.64
5.3.220.0000.06014.75
5.3.210.0100.07314.61
5.3.200.0100.05014.61
5.3.190.0130.04714.86
5.3.180.0070.05314.85
5.3.170.0130.06014.83
5.3.160.0030.05714.55
5.3.150.0170.04314.82
5.3.140.0070.05314.82
5.3.130.0100.05314.83
5.3.120.0100.05014.83
5.3.110.0100.06714.83
5.3.100.0030.06014.03
5.3.90.0070.05013.89
5.3.80.0100.04714.19
5.3.70.0070.05314.23
5.3.60.0130.06014.21
5.3.50.0100.06014.14
5.3.40.0200.05314.09
5.3.30.0200.04313.95
5.3.20.0070.05013.87
5.3.10.0170.05013.70
5.3.00.0100.04713.83
5.2.170.0130.03711.35
5.2.160.0130.04711.20
5.2.150.0100.04011.14
5.2.140.0070.04711.32
5.2.130.0130.05011.36
5.2.120.0030.04710.98
5.2.110.0070.05311.40
5.2.100.0200.02311.30
5.2.90.0100.03710.97
5.2.80.0100.04310.95
5.2.70.0070.04311.28
5.2.60.0070.04711.23
5.2.50.0130.03311.29
5.2.40.0130.04711.30
5.2.30.0130.04311.16
5.2.20.0170.03011.23
5.2.10.0030.04311.04
5.2.00.0100.06010.90
5.1.60.0030.03310.09
5.1.50.0030.04010.04
5.1.40.0030.0379.86
5.1.30.0130.03010.33
5.1.20.0030.05010.62
5.1.10.0130.0339.95
5.1.00.0030.04310.16
5.0.50.0000.0438.80
5.0.40.0070.0278.29
5.0.30.0030.0478.52
5.0.20.0100.0308.41
5.0.10.0070.0238.43
5.0.00.0070.0578.37
4.4.90.0000.0237.52
4.4.80.0070.0277.52
4.4.70.0070.0177.52
4.4.60.0000.0237.52
4.4.50.0030.0237.52
4.4.40.0000.0407.52
4.4.30.0130.0277.52
4.4.20.0030.0277.52
4.4.10.0030.0207.52
4.4.00.0000.0377.52
4.3.110.0000.0307.52
4.3.100.0100.0137.52
4.3.90.0030.0277.52
4.3.80.0130.0277.52
4.3.70.0000.0237.52
4.3.60.0070.0277.52
4.3.50.0030.0237.52
4.3.40.0030.0337.52
4.3.30.0000.0277.52
4.3.20.0000.0237.52
4.3.10.0030.0237.52
4.3.00.0100.0236.72

preferences:
45.73 ms | 401 KiB | 5 Q