3v4l.org

run code in 300+ PHP versions simultaneously
<?php function htmlWrapThing($str, $size){ $html = false; $i = 0; $chars = str_split($str); $return = ""; $break = false; $tag = ""; foreach($chars as $char){ if($char=="<") $html = true; if($char==">") $html = false; if($html) $t++; if($html && $char!="/" && $t > 1){ $tag .= $char; } if(!$html) $i++; $return .= $char; if($i==$size) $break = true; if($char == " " && !$html && $break){ if($oldtag != $tag){ $return .= '</'.$tag.'>'."<br><br>".'<'.$tag.'>'; $i=0; $tag = ""; } $oldtag = $tag; $break = false; } } return $return; } $str = "<h1>hilo everybody how is everyone doing tonight?</h1><p>hello world how is everyone doing today</p><p>hello world how is everyone doing today</p><p>hello world how is everyone doing today</p><br><br />hello everybody how are you doing today?"; echo htmlWrapThing($str,10);

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.0110.00418.55
8.3.50.0150.00821.12
8.3.40.0090.00918.92
8.3.30.0100.00319.27
8.3.20.0000.00720.29
8.3.10.0040.00423.64
8.3.00.0000.00819.26
8.2.190.0130.00718.31
8.2.180.0090.00616.50
8.2.170.0070.01319.09
8.2.160.0000.01422.96
8.2.150.0000.00724.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.86
8.2.110.0030.00721.06
8.2.100.0120.00017.91
8.2.90.0050.00317.97
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0030.00917.68
8.2.50.0040.00418.07
8.2.40.0040.00418.16
8.2.30.0060.00318.02
8.2.20.0000.00817.70
8.2.10.0040.00418.06
8.2.00.0000.00817.75
8.1.280.0070.01425.92
8.1.270.0000.00823.79
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00022.65
8.1.230.0030.00720.89
8.1.220.0050.00317.77
8.1.210.0030.00518.85
8.1.200.0090.00417.13
8.1.190.0040.00417.25
8.1.180.0000.00718.10
8.1.170.0080.00018.46
8.1.160.0040.00422.09
8.1.150.0040.00418.81
8.1.140.0040.00417.38
8.1.130.0030.00317.78
8.1.120.0080.00017.48
8.1.110.0040.00417.48
8.1.100.0000.00817.48
8.1.90.0040.00417.48
8.1.80.0040.00417.55
8.1.70.0030.00317.45
8.1.60.0030.00617.50
8.1.50.0040.00417.43
8.1.40.0030.00517.57
8.1.30.0040.00417.52
8.1.20.0000.00917.60
8.1.10.0000.00817.54
8.1.00.0030.00617.49
8.0.300.0070.00019.96
8.0.290.0040.00416.75
8.0.280.0040.00418.47
8.0.270.0030.00317.30
8.0.260.0030.00317.27
8.0.250.0020.00517.06
8.0.240.0040.00416.96
8.0.230.0000.00916.96
8.0.220.0040.00416.91
8.0.210.0030.00317.03
8.0.200.0000.00617.10
8.0.190.0040.00417.01
8.0.180.0040.00417.00
8.0.170.0030.00517.03
8.0.160.0040.00416.93
8.0.150.0030.00316.94
8.0.140.0040.00416.88
8.0.130.0030.00313.37
8.0.120.0060.00316.82
8.0.110.0030.00616.89
8.0.100.0040.00416.98
8.0.90.0030.00616.93
8.0.80.0000.01616.94
8.0.70.0020.00516.84
8.0.60.0000.00716.86
8.0.50.0050.00316.99
8.0.30.0100.01517.02
8.0.20.0100.00917.40
8.0.10.0000.00816.97
8.0.00.0100.01516.80
7.4.330.0000.00515.02
7.4.320.0030.00316.63
7.4.300.0000.00616.57
7.4.290.0070.00016.52
7.4.280.0000.00816.52
7.4.270.0040.00416.54
7.4.260.0070.00016.48
7.4.250.0070.00016.41
7.4.240.0030.00516.54
7.4.230.0030.00316.63
7.4.220.0090.00916.48
7.4.210.0060.00916.42
7.4.200.0040.00416.41
7.4.160.0050.01116.61
7.4.150.0170.00717.40
7.4.140.0110.00817.86
7.4.130.0100.00716.60
7.4.120.0100.00916.58
7.4.110.0150.00916.61
7.4.100.0080.01716.43
7.4.90.0030.01716.46
7.4.80.0150.00319.39
7.4.70.0090.00916.65
7.4.60.0080.00816.53
7.4.50.0000.00416.55
7.4.40.0030.01316.45
7.4.30.0060.01616.61
7.4.00.0090.00614.92
7.3.330.0030.00313.45
7.3.320.0060.00013.32
7.3.310.0080.00016.50
7.3.300.0060.00016.39
7.3.290.0090.00716.46
7.3.280.0040.01316.48
7.3.270.0100.01317.40
7.3.260.0080.00816.45
7.3.250.0050.01316.46
7.3.240.0090.00916.45
7.3.230.0120.00616.58
7.3.210.0040.01216.41
7.3.200.0170.00619.39
7.3.190.0070.01016.50
7.3.180.0110.00416.48
7.3.170.0060.01016.52
7.3.160.0160.00016.55
7.2.330.0030.01316.70
7.2.320.0060.01216.88
7.2.310.0130.00316.79
7.2.300.0070.01016.80
7.2.290.0090.01516.82
7.2.60.0120.00716.60
7.2.00.0000.01819.20
7.1.200.0100.00315.77
7.1.100.0000.01118.23
7.1.70.0000.01017.35
7.1.60.0090.00919.32
7.1.50.0070.01416.99
7.1.00.0030.07722.31
7.0.200.0050.00316.93
7.0.140.0070.07021.90
7.0.60.0070.08720.05
7.0.50.0030.04017.83
7.0.40.0030.08020.27
7.0.30.0570.06720.20
7.0.20.0370.07020.20
7.0.10.0030.04320.16
7.0.00.0070.05020.29
5.6.280.0070.07021.15
5.6.210.0030.04320.59
5.6.200.0000.08718.18
5.6.190.0000.06320.63
5.6.180.0030.08720.79
5.6.170.0300.08320.56
5.6.160.0100.03720.61
5.6.150.0000.04318.28
5.6.140.0070.08718.19
5.6.130.0070.07318.25
5.6.120.0000.04321.07
5.6.110.0070.08021.03
5.6.100.0000.04321.10
5.6.90.0070.08021.14
5.6.80.0030.08020.45
5.6.70.4230.04320.45
5.5.350.0200.08720.48
5.5.340.0000.04317.97
5.5.330.0030.05720.35
5.5.320.0330.06020.27
5.5.310.0270.07720.34
5.5.300.0000.08317.98
5.5.290.0070.07718.00
5.5.280.0070.03720.91
5.5.270.0000.05720.77
5.5.260.0030.08720.90
5.5.250.0100.07320.72
5.5.240.4030.04020.40
5.4.450.1000.06319.45
5.4.440.0670.07019.20
5.4.430.0130.05019.44
5.4.420.0830.05719.58
5.4.410.0770.05019.21
5.4.400.0300.06019.15
5.4.390.1330.06318.87
5.4.380.1000.06719.00
5.4.370.0930.04319.02
5.4.360.1100.05719.06
5.4.350.0670.06018.98
5.4.340.0070.03312.06
5.4.320.0060.03612.54
5.4.310.0050.03912.55
5.4.300.0060.03712.54
5.4.290.0050.04312.54
5.4.280.0040.03812.43
5.4.270.0060.03512.44
5.4.260.0040.03912.43
5.4.250.0080.03512.44
5.4.240.0060.03612.43
5.4.230.0060.03912.43
5.4.220.0030.03912.43
5.4.210.0060.03612.43
5.4.200.0040.03912.43
5.4.190.0050.03712.43
5.4.180.0070.03512.43
5.4.170.0070.03512.43
5.4.160.0060.03712.43
5.4.150.0060.04412.42
5.4.140.0080.03512.11
5.4.130.0080.04012.10
5.4.120.0090.03712.05
5.4.110.0050.03512.05
5.4.100.0050.03612.05
5.4.90.0050.03712.05
5.4.80.0050.04012.05
5.4.70.0080.03412.04
5.4.60.0070.03412.05
5.4.50.0050.03812.04
5.4.40.0070.03412.04
5.4.30.0060.03512.03
5.4.20.0040.03712.03
5.4.10.0100.04012.04
5.4.00.0050.04311.53
5.3.290.0070.04212.80
5.3.280.0050.03812.71
5.3.270.0070.03712.72
5.3.260.0080.03612.73
5.3.250.0080.04012.73
5.3.240.0080.03812.72
5.3.230.0080.03712.72
5.3.220.0060.03812.69
5.3.210.0080.04412.69
5.3.200.0080.03412.68
5.3.190.0050.03812.69
5.3.180.0070.03612.69
5.3.170.0060.03712.68
5.3.160.0050.03912.68
5.3.150.0060.03812.68
5.3.140.0080.03712.67
5.3.130.0100.04012.67
5.3.120.0050.03912.66
5.3.110.0040.04112.67
5.3.100.0050.04112.15
5.3.90.0080.03512.13
5.3.80.0060.03612.13
5.3.70.0040.03812.13
5.3.60.0100.03212.11
5.3.50.0040.03812.06
5.3.40.0060.04212.06
5.3.30.0070.03412.02
5.3.20.0080.03511.80
5.3.10.0040.04011.77
5.3.00.0080.04011.75
5.2.170.0080.0329.25
5.2.160.0130.0299.25
5.2.150.0060.0349.25
5.2.140.0050.0329.25
5.2.130.0090.0279.21
5.2.120.0060.0339.21
5.2.110.0050.0289.22
5.2.100.0030.0319.22
5.2.90.0060.0299.21
5.2.80.0020.0339.21
5.2.70.0060.0299.21
5.2.60.0060.0349.16
5.2.50.0070.0349.13
5.2.40.0020.0309.11
5.2.30.0050.0389.09
5.2.20.0040.0339.07
5.2.10.0060.0388.97
5.2.00.0060.0428.85
5.1.60.0040.0278.14
5.1.50.0070.0228.13
5.1.40.0050.0248.12
5.1.30.0030.0278.46
5.1.20.0050.0258.48
5.1.10.0050.0258.21
5.1.00.0110.0238.21
5.0.50.0070.0316.70
5.0.40.0050.0286.55
5.0.30.0020.0326.37
5.0.20.0040.0276.33
5.0.10.0030.0206.31
5.0.00.0030.0316.32
4.4.90.0030.0214.77
4.4.80.0020.0194.76
4.4.70.0010.0164.76
4.4.60.0010.0164.75
4.4.50.0080.0114.77
4.4.40.0040.0244.71
4.4.30.0030.0194.76
4.4.20.0040.0144.84
4.4.10.0010.0174.85
4.4.00.0030.0254.76
4.3.110.0030.0154.66
4.3.100.0030.0144.67
4.3.90.0030.0144.64
4.3.80.0020.0254.58
4.3.70.0030.0144.63
4.3.60.0030.0164.63
4.3.50.0020.0214.63
4.3.40.0030.0314.54
4.3.30.0000.0183.32
4.3.20.0030.0163.29
4.3.10.0020.0213.26
4.3.00.0000.0276.76

preferences:
39.73 ms | 401 KiB | 5 Q