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.0070.01118.61
8.3.50.0080.01122.08
8.3.40.0070.00719.07
8.3.30.0000.01419.13
8.3.20.0050.00220.19
8.3.10.0070.00021.96
8.3.00.0000.00822.52
8.2.180.0120.00916.75
8.2.170.0120.00922.96
8.2.160.0120.00620.57
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00017.63
8.2.110.0110.00022.26
8.2.100.0120.00017.91
8.2.90.0040.00419.21
8.2.80.0090.00019.78
8.2.70.0080.00017.88
8.2.60.0030.00617.93
8.2.50.0050.00318.07
8.2.40.0000.00918.16
8.2.30.0040.00418.17
8.2.20.0050.00317.84
8.2.10.0060.00319.71
8.2.00.0040.00417.89
8.1.280.0090.00925.92
8.1.270.0080.00021.92
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0040.00822.05
8.1.230.0110.00019.16
8.1.220.0000.00817.79
8.1.210.0030.00518.77
8.1.200.0040.00717.48
8.1.190.0000.00817.43
8.1.180.0030.00618.10
8.1.170.0030.00618.70
8.1.160.0000.00722.06
8.1.150.0000.00818.80
8.1.140.0000.00917.54
8.1.130.0050.00317.79
8.1.120.0000.00717.59
8.1.110.0070.00017.68
8.1.100.0040.00417.64
8.1.90.0030.00317.64
8.1.80.0000.00717.61
8.1.70.0000.00717.51
8.1.60.0000.00817.80
8.1.50.0070.00017.70
8.1.40.0000.00817.54
8.1.30.0040.00417.70
8.1.20.0000.00817.87
8.1.10.0000.00817.76
8.1.00.0080.00017.57
8.0.300.0040.00420.02
8.0.290.0000.00717.18
8.0.280.0030.00318.48
8.0.270.0070.00017.22
8.0.260.0000.00717.04
8.0.250.0030.00317.13
8.0.240.0000.00717.11
8.0.230.0040.00417.10
8.0.220.0070.00017.04
8.0.210.0030.00317.05
8.0.200.0070.00017.14
8.0.190.0070.00017.16
8.0.180.0000.00717.07
8.0.170.0050.00217.01
8.0.160.0000.00716.96
8.0.150.0030.00516.87
8.0.140.0040.00417.02
8.0.130.0030.00313.56
8.0.120.0040.00417.01
8.0.110.0050.00317.09
8.0.100.0040.00416.85
8.0.90.0070.00016.88
8.0.80.0030.01117.05
8.0.70.0000.00817.18
8.0.60.0040.00417.09
8.0.50.0000.00816.97
8.0.30.0130.00717.23
8.0.20.0080.01017.40
8.0.10.0040.00417.24
8.0.00.0080.01216.96
7.4.330.0070.00015.00
7.4.320.0030.00316.88
7.4.300.0000.00716.71
7.4.290.0070.00016.79
7.4.280.0070.00016.84
7.4.270.0030.00316.87
7.4.260.0020.00516.81
7.4.250.0040.00416.75
7.4.240.0020.00616.74
7.4.230.0070.00016.64
7.4.220.0170.00316.92
7.4.210.0080.00616.83
7.4.200.0080.00016.93
7.4.190.0050.00516.89
7.4.160.0100.01316.70
7.4.150.0140.00617.40
7.4.140.0140.00317.86
7.4.130.0060.01416.74
7.4.120.0100.00716.67
7.4.110.0060.01216.79
7.4.100.0060.01316.81
7.4.90.0100.00716.95
7.4.80.0070.01319.39
7.4.70.0120.00916.64
7.4.60.0160.00016.53
7.4.50.0000.00916.86
7.4.40.0060.00922.77
7.4.30.0140.00316.77
7.4.00.0090.00615.00
7.3.330.0000.00513.54
7.3.320.0020.00213.48
7.3.310.0000.00716.49
7.3.300.0000.00716.55
7.3.290.0070.01416.53
7.3.280.0080.00916.54
7.3.270.0130.00617.40
7.3.260.0160.00816.84
7.3.250.0120.00716.68
7.3.240.0120.00616.51
7.3.230.0090.01216.57
7.3.210.0130.00616.39
7.3.200.0080.00819.39
7.3.190.0060.01216.86
7.3.180.0130.00916.61
7.3.170.0100.00716.57
7.3.160.0130.00316.53
7.3.120.0000.01115.27
7.2.330.0090.00916.88
7.2.320.0130.01016.82
7.2.310.0140.01017.00
7.2.300.0090.00916.97
7.2.290.0100.00716.81
7.2.60.0070.00716.68
7.2.00.0030.00919.77
7.1.200.0100.00315.96
7.1.100.0950.00416.34
7.1.70.0000.00717.29
7.1.60.0100.01019.82
7.1.50.0100.01317.05
7.1.00.0030.07722.36
7.0.200.0120.00417.08
7.0.140.0070.07021.94
7.0.60.0100.06019.94
7.0.50.0030.05017.86
7.0.40.0000.09320.28
7.0.30.0330.07320.24
7.0.20.0270.05720.20
7.0.10.0230.04720.22
7.0.00.0070.04020.25
5.6.280.0030.07321.08
5.6.210.0070.03720.51
5.6.200.0030.06018.19
5.6.190.0130.09020.55
5.6.180.3470.04020.63
5.6.170.0300.03720.47
5.6.160.0070.05020.70
5.6.150.0030.04318.24
5.6.140.0070.04018.27
5.6.130.0100.04018.18
5.6.120.0030.08721.04
5.6.110.0200.07320.94
5.6.100.0070.09020.89
5.6.90.0100.08021.13
5.6.80.0270.05720.44
5.6.70.0330.03020.52
5.5.350.0130.06320.39
5.5.340.0170.05017.94
5.5.330.0000.07320.41
5.5.320.0170.04320.32
5.5.310.0370.07020.25
5.5.300.0100.06317.98
5.5.290.0070.08318.09
5.5.280.0130.08020.88
5.5.270.0070.04020.84
5.5.260.0170.07720.96
5.5.250.0100.05320.69
5.5.240.0100.08020.14
5.4.450.0270.03719.57
5.4.440.0200.06319.57
5.4.430.0270.05019.56
5.4.420.0270.04019.47
5.4.410.0200.04019.39
5.4.400.0200.07019.22
5.4.390.0200.07319.32
5.4.380.0200.06319.22
5.4.370.0200.04719.18
5.4.360.0270.07318.85
5.4.350.0200.04719.22
5.4.340.0170.08318.95
5.4.320.0400.06719.14
5.4.310.0300.04719.15
5.4.300.0230.07718.96
5.4.290.0270.07018.84
5.4.280.0200.08319.21
5.4.270.0230.05319.14
5.4.260.0270.04318.99
5.4.250.0270.07319.07
5.4.240.0330.04718.94
5.4.230.0200.04719.21
5.4.220.0370.06719.14
5.4.210.0300.06019.23
5.4.200.0230.04019.24
5.4.190.0200.07719.21
5.4.180.0230.08019.21
5.4.170.0300.06719.21
5.4.160.0330.06719.00
5.4.150.0230.07319.29
5.4.140.0330.06716.38
5.4.130.0170.05016.43
5.4.120.0200.07316.71
5.4.110.0370.05016.50
5.4.100.0170.07016.42
5.4.90.0230.07016.50
5.4.80.0170.07716.57
5.4.70.0200.04316.30
5.4.60.0270.05016.44
5.4.50.0270.06716.56
5.4.40.0200.05016.25
5.4.30.0230.07316.44
5.4.20.0270.07016.42
5.4.10.0230.03316.34
5.4.00.0230.07315.78
5.3.290.0270.05014.64
5.3.280.0400.06014.75
5.3.270.0300.04314.59
5.3.260.0200.07714.62
5.3.250.0270.07014.59
5.3.240.0330.06314.65
5.3.230.0330.05014.68
5.3.220.0230.06714.64
5.3.210.0130.05314.64
5.3.200.0270.06014.54
5.3.190.0200.05014.64
5.3.180.0230.05014.56
5.3.170.0230.05014.53
5.3.160.0270.07314.66
5.3.150.0200.05314.48
5.3.140.0300.06714.60
5.3.130.0300.06314.66
5.3.120.0330.04014.77
5.3.110.0170.06714.62
5.3.100.0330.06314.12
5.3.90.0230.05014.18
5.3.80.0430.05714.23
5.3.70.0300.06314.09
5.3.60.0270.06014.02
5.3.50.0200.06714.05
5.3.40.0230.06014.03
5.3.30.0270.07314.13
5.3.20.0230.04713.88
5.3.10.0300.06313.82
5.3.00.0300.06713.54
5.2.170.0270.03312.05
5.2.160.0200.05312.05
5.2.150.0230.05712.05
5.2.140.0230.04312.05
5.2.130.0130.07012.05
5.2.120.0200.06312.05
5.2.110.0170.03312.05
5.2.100.0200.05312.05
5.2.90.0230.04312.05
5.2.80.0170.03012.05
5.2.70.0130.04012.05
5.2.60.0230.02712.05
5.2.50.0170.05712.05
5.2.40.0170.04712.05
5.2.30.0200.05312.05
5.2.20.0170.02712.05
5.2.10.0270.02312.05
5.2.00.0130.03312.05
5.1.60.0130.03312.05
5.1.50.0200.02712.05
5.1.40.0130.03712.05
5.1.30.0200.05012.05
5.1.20.0200.04012.05
5.1.10.0200.04312.05
5.1.00.0200.04012.05
5.0.50.0130.03312.05
5.0.40.0100.04012.05
5.0.30.0100.05312.05
5.0.20.0130.03012.05
5.0.10.0070.04712.05
5.0.00.0130.06712.05
4.4.90.0070.01712.05
4.4.80.0070.03712.05
4.4.70.0170.01012.05
4.4.60.0030.02012.05
4.4.50.0100.02012.05
4.4.40.0030.03012.05
4.4.30.0070.03012.05
4.4.20.0100.02012.05
4.4.10.0030.03312.05
4.4.00.0100.05312.05
4.3.110.0070.03312.05
4.3.100.0130.02012.05
4.3.90.0100.03312.05
4.3.80.0130.04312.05
4.3.70.0100.03712.05
4.3.60.0130.03012.05
4.3.50.0100.03712.05
4.3.40.0100.04712.05
4.3.30.0070.02012.05
4.3.20.0030.03712.05
4.3.10.0070.02712.05
4.3.00.0030.03312.05

preferences:
46.73 ms | 401 KiB | 5 Q