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.00718.68
8.3.50.0080.01322.18
8.3.40.0100.00719.06
8.3.30.0110.00419.21
8.3.20.0050.00220.20
8.3.10.0050.00322.09
8.3.00.0000.00822.42
8.2.180.0070.00718.41
8.2.170.0110.00322.96
8.2.160.0100.00322.30
8.2.150.0000.00824.18
8.2.140.0030.00624.66
8.2.130.0090.00026.16
8.2.120.0000.00817.75
8.2.110.0060.00322.32
8.2.100.0080.00319.82
8.2.90.0000.00819.17
8.2.80.0050.00319.89
8.2.70.0000.00817.63
8.2.60.0060.00318.05
8.2.50.0000.00818.07
8.2.40.0040.00418.16
8.2.30.0050.00218.18
8.2.20.0030.00517.84
8.2.10.0040.00417.99
8.2.00.0060.00317.96
8.1.280.0100.00725.92
8.1.270.0060.00322.06
8.1.260.0040.01126.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0040.00819.09
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0000.00917.35
8.1.190.0080.00017.53
8.1.180.0060.00318.10
8.1.170.0000.00818.59
8.1.160.0040.00422.11
8.1.150.0000.00718.83
8.1.140.0030.00517.61
8.1.130.0050.00317.89
8.1.120.0000.00717.55
8.1.110.0030.00517.63
8.1.100.0000.00717.59
8.1.90.0040.00417.67
8.1.80.0050.00317.47
8.1.70.0000.00717.59
8.1.60.0030.00517.77
8.1.50.0000.00717.65
8.1.40.0000.00817.73
8.1.30.0080.00017.81
8.1.20.0000.00817.80
8.1.10.0050.00317.74
8.1.00.0000.00817.54
8.0.300.0040.00418.77
8.0.290.0070.00017.16
8.0.280.0030.00318.49
8.0.270.0070.00017.32
8.0.260.0060.00316.97
8.0.250.0000.00817.09
8.0.240.0050.00217.23
8.0.230.0040.00417.17
8.0.220.0030.00317.15
8.0.210.0030.00517.04
8.0.200.0030.00517.07
8.0.190.0060.00317.05
8.0.180.0040.00317.16
8.0.170.0080.00017.05
8.0.160.0050.00317.15
8.0.150.0030.00517.12
8.0.140.0030.00316.92
8.0.130.0050.00013.58
8.0.120.0030.00617.05
8.0.110.0000.00816.95
8.0.100.0040.00416.95
8.0.90.0050.00317.07
8.0.80.0090.00617.05
8.0.70.0040.00417.11
8.0.60.0040.00417.19
8.0.50.0040.00417.19
8.0.30.0130.00717.33
8.0.20.0120.00717.49
8.0.10.0000.00817.02
8.0.00.0150.00717.10
7.4.330.0030.00315.17
7.4.320.0030.00316.65
7.4.300.0000.00816.83
7.4.290.0020.00516.81
7.4.280.0040.00716.78
7.4.270.0040.00416.87
7.4.260.0000.00916.86
7.4.250.0070.00016.82
7.4.240.0020.00516.86
7.4.230.0070.00016.63
7.4.220.0060.01616.95
7.4.210.0090.00616.84
7.4.200.0000.00716.63
7.4.190.0040.00416.90
7.4.160.0100.01316.67
7.4.150.0150.00617.40
7.4.140.0080.01417.86
7.4.130.0060.01416.87
7.4.120.0150.00516.79
7.4.110.0170.00016.78
7.4.100.0120.00616.65
7.4.90.0030.01416.80
7.4.80.0100.00719.39
7.4.70.0070.01416.61
7.4.60.0100.00716.59
7.4.50.0050.00316.57
7.4.40.0000.01522.77
7.4.30.0030.01416.55
7.4.00.0070.01115.19
7.3.330.0070.00013.57
7.3.320.0000.00513.52
7.3.310.0040.00416.71
7.3.300.0020.00516.48
7.3.290.0070.00716.50
7.3.280.0100.00716.61
7.3.270.0130.00317.40
7.3.260.0030.01616.55
7.3.250.0120.00616.72
7.3.240.0060.01216.48
7.3.230.0190.00316.59
7.3.210.0060.01116.87
7.3.200.0080.00919.39
7.3.190.0110.00616.77
7.3.180.0130.00316.62
7.3.170.0120.01116.66
7.3.160.0110.00616.61
7.3.120.0090.00614.89
7.2.330.0140.00317.07
7.2.320.0090.01217.01
7.2.310.0100.00716.91
7.2.300.0030.01417.02
7.2.290.0100.01316.71
7.2.60.0030.01017.13
7.1.200.0040.00816.12
7.1.70.0000.01217.40
7.1.60.0040.00717.64
7.1.50.0120.00617.17
7.1.00.0100.07022.59
7.0.200.0000.00916.83
7.0.140.0030.07322.12
7.0.60.0070.07320.08
7.0.50.0030.06317.93
7.0.40.0070.05320.25
7.0.30.0230.08320.23
7.0.20.0270.06320.32
7.0.10.0330.07320.08
7.0.00.0100.07320.21
5.6.280.0030.07021.11
5.6.210.0100.07320.77
5.6.200.0030.05718.19
5.6.190.0070.05320.55
5.6.180.3930.05020.57
5.6.170.0300.03720.47
5.6.160.0130.03320.48
5.6.150.0170.07018.23
5.6.140.0100.05718.18
5.6.130.0200.05718.29
5.6.120.0100.08020.96
5.6.110.0000.06021.13
5.6.100.0000.08321.12
5.6.90.0070.04021.13
5.6.80.0100.03720.39
5.6.70.0330.06320.40
5.5.350.0000.03320.48
5.5.340.0130.03317.95
5.5.330.0130.03320.38
5.5.320.0270.07320.30
5.5.310.0330.06320.51
5.5.300.0000.04717.99
5.5.290.0070.08017.99
5.5.280.0030.04720.80
5.5.270.0070.08320.89
5.5.260.0100.07720.98
5.5.250.0170.06720.62
5.5.240.0070.04020.04
5.4.450.0370.06719.45
5.4.440.0130.07019.31
5.4.430.0130.05319.46
5.4.420.0030.06319.39
5.4.410.0230.04019.41
5.4.400.0170.04318.83
5.4.390.0130.05018.79
5.4.380.0270.05018.63
5.4.370.0230.04718.52
5.4.360.0200.04718.79
5.4.350.0130.05718.57
5.4.340.0170.05318.60
5.4.320.0100.03912.50
5.4.310.0090.03912.50
5.4.300.0030.04812.51
5.4.290.0080.04012.50
5.4.280.0060.03712.39
5.4.270.0030.06718.98
5.4.260.0070.05319.05
5.4.250.0070.06019.00
5.4.240.0070.05319.00
5.4.230.0100.05318.92
5.4.220.0100.05318.95
5.4.210.0030.06319.14
5.4.200.0030.05718.97
5.4.190.0070.05318.92
5.4.180.0170.04019.00
5.4.170.0130.04718.82
5.4.160.0100.05019.02
5.4.150.0000.06319.01
5.4.140.0070.05316.60
5.4.130.0130.04316.38
5.4.120.0130.04316.65
5.4.110.0030.05716.61
5.4.100.0070.05016.41
5.4.90.0100.04716.48
5.4.80.0170.04716.62
5.4.70.0030.05016.63
5.4.60.0130.04716.66
5.4.50.0130.04316.39
5.4.40.0070.05016.48
5.4.30.0170.04016.68
5.4.20.0070.05016.56
5.4.10.0030.08016.64
5.4.00.0100.05015.78
5.3.290.0070.03812.80
5.3.280.0170.04314.87
5.3.270.0100.05314.66
5.3.260.0130.04714.68
5.3.250.0100.05014.86
5.3.240.0100.05314.87
5.3.230.0070.05014.68
5.3.220.0000.05714.62
5.3.210.0100.05714.62
5.3.200.0130.04314.62
5.3.190.0070.05714.68
5.3.180.0070.07714.78
5.3.170.0100.06014.61
5.3.160.0100.06714.75
5.3.150.0070.05714.85
5.3.140.0030.05314.61
5.3.130.0170.04314.54
5.3.120.0130.06014.82
5.3.110.0070.05314.82
5.3.100.0170.05014.30
5.3.90.0100.04714.19
5.3.80.0100.05014.14
5.3.70.0000.06014.33
5.3.60.0100.06714.29
5.3.50.0200.05014.16
5.3.40.0100.05313.83
5.3.30.0170.03714.19
5.3.20.0030.05313.82
5.3.10.0030.05313.85
5.3.00.0100.04713.93
5.2.170.0070.04011.32
5.2.160.0070.04311.36
5.2.150.0000.04711.20
5.2.140.0030.05311.14
5.2.130.0000.05011.38
5.2.120.0130.03311.40
5.2.110.0100.03311.15
5.2.100.0030.04011.30
5.2.90.0000.04711.31
5.2.80.0030.04311.38
5.2.70.0000.05011.38
5.2.60.0000.04711.34
5.2.50.0030.06011.31
5.2.40.0070.05311.13
5.2.30.0200.04711.03
5.2.20.0000.04311.25
5.2.10.0070.03711.12
5.2.00.0030.04710.99
5.1.60.0000.04010.20
5.1.50.0130.02710.20
5.1.40.0100.04310.24
5.1.30.0100.04310.54
5.1.20.0000.04010.41
5.1.10.0000.04310.17
5.1.00.0030.04010.17
5.0.50.0130.0308.54
5.0.40.0070.0338.65
5.0.30.0030.0608.52
5.0.20.0070.0238.42
5.0.10.0000.0308.39
5.0.00.0070.0408.47
4.4.90.0000.0337.23
4.4.80.0030.0337.23
4.4.70.0030.0207.23
4.4.60.0030.0207.23
4.4.50.0070.0237.23
4.4.40.0030.0337.23
4.4.30.0030.0207.23
4.4.20.0100.0237.23
4.4.10.0070.0177.23
4.4.00.0070.0337.49
4.3.110.0070.0307.49
4.3.100.0100.0137.49
4.3.90.0030.0207.49
4.3.80.0070.0307.49
4.3.70.0070.0207.49
4.3.60.0070.0177.49
4.3.50.0070.0277.49
4.3.40.0000.0337.49
4.3.30.0070.0207.49
4.3.20.0030.0237.49
4.3.10.0030.0307.49
4.3.00.0100.0276.73

preferences:
51.09 ms | 400 KiB | 5 Q