3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "This is a #hastag within some #awesometext."; function tagIt($body) { $string = $body; $htag = "#"; $arr = preg_split("/(?!#)\b/", $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=$arr[$i]'>".$arr[$i]."</a>"; } $i++; } $string = implode(" ", $arr); echo "\n".$string."\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.0110.00418.43
8.3.50.0130.00621.99
8.3.40.0100.00618.92
8.3.30.0030.01019.09
8.3.20.0000.00820.29
8.3.10.0030.00622.05
8.3.00.0040.00422.31
8.2.180.0180.00416.50
8.2.170.0120.00922.96
8.2.160.0140.00320.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0140.00026.16
8.2.120.0050.00317.88
8.2.110.0100.00022.38
8.2.100.0040.00818.16
8.2.90.0000.00818.09
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0000.00818.04
8.2.50.0000.00818.07
8.2.40.0030.00618.16
8.2.30.0030.00618.13
8.2.20.0040.00418.06
8.2.10.0000.00819.64
8.2.00.0080.00018.00
8.1.280.0140.00725.92
8.1.270.0040.00422.00
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00322.59
8.1.230.0080.00420.95
8.1.220.0040.00817.76
8.1.210.0050.00518.96
8.1.200.0060.00317.48
8.1.190.0040.00417.50
8.1.180.0000.00918.10
8.1.170.0050.00318.76
8.1.160.0040.00422.05
8.1.150.0070.00018.81
8.1.140.0000.00717.64
8.1.130.0040.00417.88
8.1.120.0040.00417.63
8.1.110.0000.00817.51
8.1.100.0050.00217.50
8.1.90.0030.00317.53
8.1.80.0000.00717.57
8.1.70.0040.00417.63
8.1.60.0040.00417.64
8.1.50.0070.00017.71
8.1.40.0040.00417.66
8.1.30.0000.00817.71
8.1.20.0000.00817.79
8.1.10.0030.00517.82
8.1.00.0000.00817.60
8.0.300.0040.00419.88
8.0.290.0060.00317.30
8.0.280.0000.00718.38
8.0.270.0030.00317.29
8.0.260.0000.00618.57
8.0.250.0070.00017.20
8.0.240.0040.00417.23
8.0.230.0040.00417.25
8.0.220.0000.00717.12
8.0.210.0030.00317.00
8.0.200.0000.00717.14
8.0.190.0070.00017.22
8.0.180.0000.00717.12
8.0.170.0040.00417.00
8.0.160.0000.00917.12
8.0.150.0070.00017.09
8.0.140.0000.00717.09
8.0.130.0030.00313.57
8.0.120.0040.00417.07
8.0.110.0030.00517.02
8.0.100.0030.00517.08
8.0.90.0040.00416.91
8.0.80.0060.01317.06
8.0.70.0040.00417.01
8.0.60.0040.00416.91
8.0.50.0020.00517.11
8.0.30.0110.01017.33
8.0.20.0110.01017.40
8.0.10.0000.00717.21
8.0.00.0140.00817.09
7.4.330.0040.00415.00
7.4.320.0030.00316.82
7.4.300.0000.00816.75
7.4.290.0070.00016.72
7.4.280.0030.00316.66
7.4.270.0070.00016.73
7.4.260.0070.00016.68
7.4.250.0000.00716.79
7.4.240.0000.00716.73
7.4.230.0030.00316.87
7.4.220.0070.01716.78
7.4.210.0080.00716.87
7.4.200.0070.00016.65
7.4.190.0080.00016.83
7.4.160.0120.00616.58
7.4.150.0030.01317.40
7.4.140.0060.01317.86
7.4.130.0070.01016.70
7.4.120.0060.01216.80
7.4.110.0080.00816.73
7.4.100.0100.00716.86
7.4.90.0070.01116.66
7.4.80.0130.00619.39
7.4.70.0090.00916.95
7.4.60.0130.00416.66
7.4.50.0020.00216.92
7.4.40.0040.01522.77
7.4.30.0090.00916.76
7.4.00.0040.01114.96
7.3.330.0000.00513.46
7.3.320.0030.00313.53
7.3.310.0030.00316.60
7.3.300.0070.00016.51
7.3.290.0040.01216.58
7.3.280.0090.00916.61
7.3.270.0140.00317.40
7.3.260.0060.01216.84
7.3.250.0030.01416.74
7.3.240.0110.00716.53
7.3.230.0090.00816.65
7.3.210.0100.00716.56
7.3.200.0100.01019.39
7.3.190.0110.01116.90
7.3.180.0170.00616.46
7.3.170.0030.01316.50
7.3.160.0070.01316.85
7.3.120.0000.01715.04
7.3.10.0080.00816.88
7.3.00.0130.00316.84
7.2.330.0030.01416.86
7.2.320.0070.01516.63
7.2.310.0120.00416.61
7.2.300.0160.00416.84
7.2.290.0170.00516.94
7.2.130.0110.00416.88
7.2.120.0100.00717.22
7.2.110.0060.00917.04
7.2.100.0050.00516.88
7.2.90.0090.00617.28
7.2.80.0000.01217.32
7.2.70.0140.00317.22
7.2.60.0060.00316.91
7.2.50.0000.01316.98
7.2.40.0040.00717.18
7.2.30.0100.00617.18
7.2.20.0000.01217.27
7.2.10.0060.00917.05
7.2.00.0030.01018.41
7.1.250.0030.01015.91
7.1.100.0940.01016.74
7.1.70.0030.01317.35
7.1.60.0100.01319.82
7.1.50.0100.01617.04
7.1.00.0030.07722.52
7.0.200.0100.00316.78
7.0.140.0070.06721.98
7.0.60.0070.08319.92
7.0.50.0100.07717.94
7.0.40.0070.04020.07
7.0.30.0100.05020.10
7.0.20.0370.07020.07
7.0.10.0070.08720.24
7.0.00.0030.08720.31
5.6.280.0030.07320.82
5.6.210.0070.06720.63
5.6.200.0100.07718.16
5.6.190.0170.06020.61
5.6.180.0400.05320.48
5.6.170.0270.08020.62
5.6.160.0030.04320.57
5.6.150.0070.05718.18
5.6.140.0100.07718.21
5.6.130.0130.04318.13
5.6.120.0100.07021.00
5.6.110.0070.04721.13
5.6.100.0070.03721.01
5.6.90.0070.07321.11
5.6.80.0030.06720.53
5.5.350.0270.07720.30
5.5.340.0100.08318.08
5.5.330.0170.05720.42
5.5.320.3500.04020.25
5.5.310.0230.08020.34
5.5.300.0100.03718.00
5.5.290.0070.08018.07
5.5.280.0030.04320.97
5.5.270.0100.03720.97
5.5.260.0170.07320.87
5.5.250.0130.03020.71
5.5.240.0330.07320.13
5.4.450.0470.06019.55
5.4.440.0800.06319.61
5.4.430.0970.06019.31
5.4.420.0200.05319.33
5.4.410.0670.05319.35
5.4.400.0770.04719.15
5.4.390.0730.05719.26
5.4.380.0330.04018.59
5.4.370.0070.05318.45
5.4.360.0070.03718.72
5.4.350.0090.03112.02
5.4.340.0110.03112.02
5.4.320.0060.03612.50
5.4.310.0080.04112.50
5.4.300.0060.03612.50
5.4.290.0070.04112.50
5.4.280.0070.04112.40
5.4.270.0230.04718.98
5.4.260.0070.05719.07
5.4.250.0070.05718.98
5.4.240.0070.05719.10
5.4.230.0070.05319.23
5.4.220.0070.06018.99
5.4.210.0100.05318.91
5.4.200.0170.04718.94
5.4.190.0000.06018.91
5.4.180.0200.04018.93
5.4.170.0130.05318.80
5.4.160.0100.05718.81
5.4.150.0130.05318.99
5.4.140.0200.05716.36
5.4.130.0030.05316.35
5.4.120.0170.05016.59
5.4.110.0230.06016.64
5.4.100.0070.05316.64
5.4.90.0100.04716.71
5.4.80.0170.04316.63
5.4.70.0130.05316.67
5.4.60.0130.04716.50
5.4.50.0030.05016.52
5.4.40.0100.04716.55
5.4.30.0100.05016.61
5.4.20.0130.04716.54
5.4.10.0170.06716.38
5.4.00.0170.04316.09
5.3.290.0060.04412.80
5.3.280.0130.05714.79
5.3.270.0100.05314.46
5.3.260.0100.06014.48
5.3.250.0130.04714.87
5.3.240.0070.05314.88
5.3.230.0100.05014.64
5.3.220.0130.04714.75
5.3.210.0030.05714.83
5.3.200.0100.04714.79
5.3.190.0070.05314.68
5.3.180.0130.05314.62
5.3.170.0200.04014.75
5.3.160.0130.04314.64
5.3.150.0230.05314.86
5.3.140.0070.05014.60
5.3.130.0130.05714.72
5.3.120.0200.04014.84
5.3.110.0100.05714.60
5.3.100.0100.05014.25
5.3.90.0100.04714.07
5.3.80.0030.05314.07
5.3.70.0100.05714.20
5.3.60.0070.05014.22
5.3.50.0030.05314.21
5.3.40.0230.05014.26
5.3.30.0100.04714.09
5.3.20.0170.06013.58
5.3.10.0170.04013.87
5.3.00.0100.06713.52
5.2.170.0000.05011.14
5.2.160.0100.05311.14
5.2.150.0100.05311.02
5.2.140.0030.05711.36
5.2.130.0070.04311.21
5.2.120.0070.04011.10
5.2.110.0100.03711.27
5.2.100.0000.04711.30
5.2.90.0070.04011.14
5.2.80.0170.03311.27
5.2.70.0130.05011.09
5.2.60.0100.04011.18
5.2.50.0130.04011.29
5.2.40.0100.04311.29
5.2.30.0030.04311.17
5.2.20.0100.03711.27
5.2.10.0070.04010.74
5.2.00.0000.05710.90
5.1.60.0000.0579.88
5.1.50.0030.04710.05
5.1.40.0130.04310.13
5.1.30.0000.04010.52
5.1.20.0170.03010.57
5.1.10.0100.03010.30
5.1.00.0070.05010.39
5.0.50.0100.0238.85
5.0.40.0030.0278.52
5.0.30.0100.0438.54
5.0.20.0000.0338.45
5.0.10.0000.0338.47
5.0.00.0030.0478.36
4.4.90.0000.0337.56
4.4.80.0030.0237.56
4.4.70.0100.0207.56
4.4.60.0030.0237.56
4.4.50.0030.0207.56
4.4.40.0170.0277.56
4.4.30.0100.0137.56
4.4.20.0030.0207.56
4.4.10.0030.0277.56
4.4.00.0000.0407.56
4.3.110.0030.0237.56
4.3.100.0000.0237.56
4.3.90.0030.0237.56
4.3.80.0030.0377.56
4.3.70.0070.0237.56
4.3.60.0100.0207.56
4.3.50.0000.0237.56
4.3.40.0000.0337.56
4.3.30.0000.0237.56
4.3.20.0070.0237.56
4.3.10.0070.0207.56
4.3.00.0070.0207.00

preferences:
42 ms | 401 KiB | 5 Q