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("/(\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=$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.70.0120.00618.55
8.3.60.0070.01418.68
8.3.50.0150.00322.13
8.3.40.0170.00019.01
8.3.30.0110.00319.18
8.3.20.0000.00720.38
8.3.10.0040.00422.09
8.3.00.0040.00422.57
8.2.190.0060.01216.69
8.2.180.0070.01516.75
8.2.170.0080.00822.96
8.2.160.0100.00722.34
8.2.150.0040.00424.18
8.2.140.0050.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00317.72
8.2.110.0000.00922.20
8.2.100.0130.00017.97
8.2.90.0000.00819.38
8.2.80.0050.00318.16
8.2.70.0040.00417.75
8.2.60.0020.01018.04
8.2.50.0030.00618.07
8.2.40.0080.00318.34
8.2.30.0040.00418.14
8.2.20.0000.00717.83
8.2.10.0040.00419.59
8.2.00.0060.00317.91
8.1.280.0070.01325.92
8.1.270.0080.00022.30
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00823.85
8.1.230.0040.00719.10
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0060.00317.38
8.1.190.0050.00317.63
8.1.180.0000.01318.10
8.1.170.0000.00818.59
8.1.160.0000.00822.11
8.1.150.0050.00218.73
8.1.140.0000.00817.71
8.1.130.0000.00717.86
8.1.120.0040.00417.68
8.1.110.0030.00517.57
8.1.100.0000.00717.68
8.1.90.0000.00817.58
8.1.80.0040.00417.62
8.1.70.0040.00417.54
8.1.60.0000.00817.77
8.1.50.0050.00317.70
8.1.40.0000.00717.68
8.1.30.0050.00317.71
8.1.20.0030.00617.65
8.1.10.0000.00717.64
8.1.00.0000.00817.51
8.0.300.0000.00718.77
8.0.290.0030.00617.18
8.0.280.0000.00718.41
8.0.270.0070.00017.35
8.0.260.0070.00016.98
8.0.250.0000.00817.04
8.0.240.0040.00417.07
8.0.230.0000.00717.09
8.0.220.0030.00317.10
8.0.210.0040.00417.03
8.0.200.0000.00617.09
8.0.190.0040.00417.19
8.0.180.0000.00817.13
8.0.170.0080.00017.09
8.0.160.0000.00717.15
8.0.150.0000.00817.03
8.0.140.0040.00417.00
8.0.130.0000.00613.51
8.0.120.0080.00016.90
8.0.110.0040.00417.11
8.0.100.0040.00417.13
8.0.90.0000.00717.07
8.0.80.0060.01317.03
8.0.70.0040.00417.10
8.0.60.0040.00416.95
8.0.50.0040.00416.88
8.0.30.0090.01017.40
8.0.20.0110.01117.44
8.0.10.0030.00617.14
8.0.00.0150.00317.00
7.4.330.0070.00015.00
7.4.320.0000.00616.65
7.4.300.0030.00316.88
7.4.290.0030.00316.83
7.4.280.0080.00016.69
7.4.270.0000.00716.85
7.4.260.0080.00016.74
7.4.250.0000.00716.57
7.4.240.0020.00516.70
7.4.230.0020.00516.79
7.4.220.0120.00316.78
7.4.210.0060.01016.76
7.4.200.0050.00216.60
7.4.190.0040.00416.79
7.4.160.0120.00416.62
7.4.150.0090.00917.40
7.4.140.0060.01417.86
7.4.130.0100.00716.90
7.4.120.0090.00816.75
7.4.110.0100.01016.79
7.4.100.0120.01216.61
7.4.90.0110.00616.59
7.4.80.0090.01219.39
7.4.70.0070.01016.75
7.4.60.0120.00916.54
7.4.50.0060.00316.84
7.4.40.0140.00022.77
7.4.30.0090.00916.62
7.4.00.0130.00014.96
7.3.330.0050.00013.46
7.3.320.0000.00613.30
7.3.310.0030.00316.50
7.3.300.0000.00616.53
7.3.290.0040.01116.57
7.3.280.0080.00816.50
7.3.270.0100.00717.40
7.3.260.0090.00916.75
7.3.250.0060.01316.65
7.3.240.0090.00916.68
7.3.230.0100.01016.81
7.3.210.0110.00716.73
7.3.200.0150.00319.39
7.3.190.0170.00316.57
7.3.180.0070.01016.46
7.3.170.0150.00616.68
7.3.160.0070.01016.92
7.3.120.0100.00715.04
7.2.330.0130.00516.93
7.2.320.0160.00616.94
7.2.310.0100.00716.86
7.2.300.0090.00916.99
7.2.290.0070.01116.98
7.1.70.0110.00017.24
7.1.60.0060.00919.82
7.1.50.0040.01517.22
7.1.00.0070.07022.29
7.0.200.0070.00717.05
7.0.140.0130.06322.10
7.0.60.0030.08720.11
7.0.50.0000.06717.89
7.0.40.0070.04020.29
7.0.30.0470.06320.25
7.0.20.0230.05320.16
7.0.10.0270.08020.24
7.0.00.0100.06320.25
5.6.280.0000.07721.07
5.6.210.0100.07720.47
5.6.200.0030.08718.16
5.6.190.0100.08720.48
5.6.180.0300.08020.61
5.6.170.0330.04720.55
5.6.160.0100.03720.46
5.6.150.0070.08018.19
5.6.140.0030.04018.13
5.6.130.0000.08718.29
5.6.120.0100.08021.09
5.6.110.0070.04320.99
5.6.100.0100.07320.98
5.6.90.0170.08020.96
5.6.80.0130.08020.41
5.6.70.0330.06320.38
5.5.350.0300.07020.47
5.5.340.0200.07017.93
5.5.330.0100.08020.43
5.5.320.0200.06020.24
5.5.310.0270.07720.34
5.5.300.0100.03317.92
5.5.290.0100.08018.04
5.5.280.0100.08320.80
5.5.270.0100.08020.96
5.5.260.0070.07720.80
5.5.250.0000.05020.59
5.5.240.0030.07320.38
5.4.450.0170.04319.14
5.4.440.0130.07719.55
5.4.430.0130.05019.32
5.4.420.0230.07019.52
5.4.410.0200.03719.14
5.4.400.0200.08019.14
5.4.390.0200.07018.82
5.4.380.0170.06719.09
5.4.370.0200.04019.09
5.4.360.0300.07318.88
5.4.350.0200.03718.86
5.4.340.0430.03319.15
5.4.320.0270.07018.98
5.4.310.0270.06719.13
5.4.300.0270.03718.98
5.4.290.0230.03319.21
5.4.280.0270.07019.25
5.4.270.0230.04018.98
5.4.260.0330.06719.24
5.4.250.0270.07319.30
5.4.240.0230.03319.21
5.4.230.0200.05319.14
5.4.220.0270.05318.94
5.4.210.0300.06019.09
5.4.200.0100.06019.08
5.4.190.0000.07719.23
5.4.180.0070.04719.07
5.4.170.0070.05019.07
5.4.160.0070.06719.18
5.4.150.0100.04319.12
5.4.140.0100.05016.57
5.4.130.0070.06016.50
5.4.120.0070.06316.45
5.4.110.0100.03716.32
5.4.100.0000.05016.50
5.4.90.0030.07016.68
5.4.80.0170.05316.23
5.4.70.0000.04316.57
5.4.60.0000.04716.48
5.4.50.0070.04316.43
5.4.40.0030.07716.51
5.4.30.0070.07316.38
5.4.20.0030.06316.48
5.4.10.0070.04316.53
5.4.00.0000.04715.77
5.3.290.0330.04314.64
5.3.280.0230.06714.60
5.3.270.0070.08014.53
5.3.260.0100.07314.76
5.3.250.0070.04714.50
5.3.240.0070.05314.71
5.3.230.0170.04314.58
5.3.220.0070.07014.55
5.3.210.0100.04314.57
5.3.200.0000.04014.55
5.3.190.0070.06014.72
5.3.180.0000.06314.63
5.3.170.0000.06014.61
5.3.160.0030.04314.46
5.3.150.0070.07314.68
5.3.140.0030.03714.47
5.3.130.0030.06714.55
5.3.120.0100.07314.77
5.3.110.0030.06314.52
5.3.100.0100.06314.01
5.3.90.0070.07014.03
5.3.80.0030.04314.10
5.3.70.0030.07713.99
5.3.60.0000.06314.12
5.3.50.0000.06013.85
5.3.40.0070.06314.03
5.3.30.0070.06713.81
5.3.20.0070.06013.62
5.3.10.0070.07013.67
5.3.00.0100.03713.56
5.2.170.0030.06011.75
5.2.160.0030.05711.75
5.2.150.0030.05011.75
5.2.140.0030.06311.75
5.2.130.0030.05011.75
5.2.120.0030.06011.75
5.2.110.0070.05011.75
5.2.100.0000.03711.75
5.2.90.0030.04011.75
5.2.80.0000.03711.75
5.2.70.0030.06011.75
5.2.60.0030.05311.75
5.2.50.0130.04711.75
5.2.40.0070.05711.75
5.2.30.0030.05311.75
5.2.20.0000.05711.75
5.2.10.0100.06011.75
5.2.00.0130.05711.75
5.1.60.0100.05711.75
5.1.50.0130.03311.75
5.1.40.0030.04711.75
5.1.30.0030.03311.75
5.1.20.0000.05011.75
5.1.10.0100.04711.75
5.1.00.0030.04011.75
5.0.50.0000.04311.75
5.0.40.0000.03711.75
5.0.30.0030.05011.75
5.0.20.0000.04011.75
5.0.10.0030.04711.75
5.0.00.0070.03711.75
4.4.90.0030.03311.75
4.4.80.0030.03011.75
4.4.70.0030.03711.75
4.4.60.0030.03711.75
4.4.50.0000.03311.75
4.4.40.0070.05311.75
4.4.30.0070.01711.75
4.4.20.0070.03311.75
4.4.10.0000.02311.75
4.4.00.0030.05011.75
4.3.110.0030.03311.75
4.3.100.0030.02011.75
4.3.90.0000.03311.75
4.3.80.0000.05711.75
4.3.70.0000.03011.75
4.3.60.0030.03711.75
4.3.50.0000.03011.75
4.3.40.0000.04711.75
4.3.30.0100.01711.75
4.3.20.0030.03711.75
4.3.10.0100.03011.75
4.3.00.0000.03711.75

preferences:
41.34 ms | 401 KiB | 5 Q