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){ $return .= '</'.$tag.'>'."<br><br>".'<'.$tag.'>'; $i=0; $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 />"; 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.60.0040.01118.68
8.3.50.0110.00921.26
8.3.40.0070.00718.97
8.3.30.0080.00619.09
8.3.20.0040.00420.38
8.3.10.0000.00823.65
8.3.00.0050.00319.38
8.2.180.0120.00316.38
8.2.170.0140.00022.96
8.2.160.0070.00720.47
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0090.00026.16
8.2.120.0070.00317.75
8.2.110.0110.00022.26
8.2.100.0060.00617.75
8.2.90.0000.00818.96
8.2.80.0090.00017.97
8.2.70.0030.00617.63
8.2.60.0030.00717.68
8.2.50.0060.00318.07
8.2.40.0040.00420.07
8.2.30.0030.00518.04
8.2.20.0080.00017.82
8.2.10.0040.00418.05
8.2.00.0040.00417.79
8.1.280.0000.01425.92
8.1.270.0000.01123.61
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00623.80
8.1.230.0070.00419.15
8.1.220.0040.00417.77
8.1.210.0000.01118.77
8.1.200.0030.00917.22
8.1.190.0050.00317.23
8.1.180.0000.00718.10
8.1.170.0050.00218.50
8.1.160.0030.00622.00
8.1.150.0000.00718.90
8.1.140.0070.00017.39
8.1.130.0000.00719.53
8.1.120.0000.00817.51
8.1.110.0040.00417.31
8.1.100.0000.00717.45
8.1.90.0030.00317.45
8.1.80.0030.00417.52
8.1.70.0070.00017.35
8.1.60.0000.00817.50
8.1.50.0000.00717.49
8.1.40.0060.00317.49
8.1.30.0050.00317.71
8.1.20.0030.00517.64
8.1.10.0040.00417.55
8.1.00.0000.00817.41
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0040.00418.47
8.0.270.0030.00317.18
8.0.260.0030.00317.16
8.0.250.0070.00017.01
8.0.240.0080.00016.99
8.0.230.0000.00717.10
8.0.220.0050.00316.97
8.0.210.0030.00316.96
8.0.200.0030.00316.98
8.0.190.0040.00417.11
8.0.180.0000.00816.99
8.0.170.0080.00016.97
8.0.160.0040.00416.89
8.0.150.0080.00016.94
8.0.140.0000.00716.82
8.0.130.0060.00013.43
8.0.120.0080.00016.91
8.0.110.0040.00416.98
8.0.100.0000.00716.87
8.0.90.0070.00017.02
8.0.80.0090.00616.93
8.0.70.0000.00716.86
8.0.60.0000.00716.87
8.0.50.0050.00316.85
8.0.30.0070.01517.28
8.0.20.0030.01717.40
8.0.10.0040.00417.00
8.0.00.0060.01516.99
7.4.330.0000.00515.02
7.4.320.0070.00016.53
7.4.300.0000.00816.45
7.4.290.0070.00016.39
7.4.280.0040.00416.53
7.4.270.0070.00016.44
7.4.260.0030.00316.51
7.4.250.0070.00016.55
7.4.240.0000.00716.55
7.4.230.0040.00416.71
7.4.220.0070.01416.61
7.4.210.0030.01116.64
7.4.200.0030.00316.42
7.4.160.0060.01016.59
7.4.150.0130.01017.40
7.4.140.0060.01317.86
7.4.130.0120.00916.67
7.4.120.0080.00916.51
7.4.110.0040.01416.57
7.4.100.0070.01016.59
7.4.90.0100.00716.68
7.4.80.0040.01619.39
7.4.70.0140.00616.46
7.4.60.0100.00616.70
7.4.50.0000.00816.46
7.4.40.0110.00616.49
7.4.30.0130.00316.61
7.4.00.0090.00615.11
7.3.330.0000.00513.52
7.3.320.0000.00513.32
7.3.310.0050.00216.27
7.3.300.0000.00716.46
7.3.290.0110.00716.41
7.3.280.0070.00916.42
7.3.270.0090.00917.40
7.3.260.0070.01016.61
7.3.250.0070.01016.47
7.3.240.0100.00716.64
7.3.230.0140.00616.59
7.3.210.0100.00616.49
7.3.200.0100.00619.39
7.3.190.0070.01416.53
7.3.180.0080.00816.46
7.3.170.0040.01116.62
7.3.160.0090.00616.45
7.3.10.0030.01016.72
7.3.00.0080.00816.75
7.2.330.0090.00916.78
7.2.320.0030.01416.73
7.2.310.0150.00316.43
7.2.300.0090.00716.73
7.2.290.0100.01016.43
7.2.130.0080.01016.91
7.2.120.0050.00916.84
7.2.110.0060.00816.75
7.2.100.0140.00616.91
7.2.90.0130.00716.98
7.2.80.0070.01216.94
7.2.70.0130.00516.94
7.2.60.0100.00916.80
7.2.50.0080.01016.76
7.2.40.0140.00516.80
7.2.30.0080.00717.01
7.2.20.0080.01016.83
7.2.10.0130.00616.92
7.2.00.0060.00717.73
7.1.250.0100.00715.80
7.1.100.0000.01518.19
7.1.70.0000.00817.38
7.1.60.0040.00817.16
7.1.50.0060.01916.68
7.1.00.0000.08022.47
7.0.200.0090.00916.54
7.0.140.0000.07722.12
7.0.60.0100.08020.04
7.0.50.0070.07717.86
7.0.40.0070.08720.20
7.0.30.0400.04720.12
7.0.20.0270.05320.16
7.0.10.0170.06320.16
7.0.00.0030.08020.11
5.6.280.0030.07321.13
5.6.210.0030.05320.62
5.6.200.0130.07018.13
5.6.190.0070.08320.52
5.6.180.0130.04320.47
5.6.170.0230.07320.47
5.6.160.0170.04320.44
5.6.150.0030.08018.18
5.6.140.0100.08018.16
5.6.130.0070.06318.15
5.6.120.0170.07721.03
5.6.110.0030.04320.98
5.6.100.0230.07320.98
5.6.90.0170.07721.03
5.6.80.0070.05020.37
5.6.70.3170.03720.53
5.5.350.0370.07320.39
5.5.340.0070.07718.07
5.5.330.0100.08020.57
5.5.320.0430.06720.31
5.5.310.0230.08720.46
5.5.300.0100.08017.99
5.5.290.0030.05317.98
5.5.280.0170.07320.66
5.5.270.0100.08720.98
5.5.260.0130.07720.85
5.5.250.0130.08020.70
5.5.240.4330.03720.27
5.4.450.1000.05719.46
5.4.440.0730.05319.48
5.4.430.0670.06719.61
5.4.420.1070.06719.58
5.4.410.0530.05319.35
5.4.400.0770.05319.00
5.4.390.0730.05319.23
5.4.380.0670.05718.84
5.4.370.0900.05318.87
5.4.360.0870.05019.00
5.4.350.0730.06019.31
5.4.340.0080.03312.05
5.4.320.0040.03812.53
5.4.310.0020.04112.52
5.4.300.0050.03712.54
5.4.290.0050.03812.53
5.4.280.0070.03312.42
5.4.270.0030.03912.43
5.4.260.0020.04112.43
5.4.250.0060.03812.43
5.4.240.0040.04112.43
5.4.230.0070.03712.42
5.4.220.0040.04412.42
5.4.210.0050.04312.42
5.4.200.0070.04112.42
5.4.190.0040.03812.41
5.4.180.0060.03612.41
5.4.170.0050.03712.42
5.4.160.0030.03812.42
5.4.150.0030.03912.42
5.4.140.0030.03912.10
5.4.130.0030.03712.08
5.4.120.0070.03312.05
5.4.110.0060.03512.04
5.4.100.0060.03612.04
5.4.90.0030.03912.04
5.4.80.0070.04312.04
5.4.70.0090.03312.04
5.4.60.0060.03812.03
5.4.50.0070.03612.04
5.4.40.0090.04612.03
5.4.30.0100.03112.02
5.4.20.0070.03312.02
5.4.10.0060.03412.02
5.4.00.0060.03611.51
5.3.290.0040.04112.80
5.3.280.0060.03712.71
5.3.270.0080.03812.72
5.3.260.0040.04212.72
5.3.250.0060.03712.72
5.3.240.0070.03612.72
5.3.230.0070.03612.71
5.3.220.0050.03812.68
5.3.210.0040.04112.68
5.3.200.0050.03812.68
5.3.190.0090.03512.68
5.3.180.0070.03612.67
5.3.170.0070.03512.67
5.3.160.0060.03712.68
5.3.150.0090.04012.68
5.3.140.0050.04212.66
5.3.130.0090.03412.66
5.3.120.0030.04112.66
5.3.110.0100.03612.66
5.3.100.0080.03512.14
5.3.90.0060.03612.13
5.3.80.0040.03912.13
5.3.70.0070.03512.13
5.3.60.0060.03512.11
5.3.50.0040.03712.05
5.3.40.0030.04012.05
5.3.30.0050.03512.01
5.3.20.0050.03511.80
5.3.10.0050.03411.76
5.3.00.0030.03911.75
5.2.170.0050.0369.25
5.2.160.0070.0459.25
5.2.150.0050.0299.25
5.2.140.0070.0299.25
5.2.130.0020.0319.21
5.2.120.0050.0329.21
5.2.110.0030.0309.21
5.2.100.0040.0289.21
5.2.90.0030.0299.21
5.2.80.0040.0349.21
5.2.70.0040.0399.21
5.2.60.0050.0289.16
5.2.50.0060.0279.13
5.2.40.0060.0279.11
5.2.30.0050.0339.08
5.2.20.0020.0319.07
5.2.10.0030.0298.98
5.2.00.0050.0318.84
5.1.60.0040.0278.13
5.1.50.0050.0258.13
5.1.40.0030.0288.11
5.1.30.0090.0318.46
5.1.20.0060.0288.48
5.1.10.0020.0288.20
5.1.00.0060.0258.20
5.0.50.0050.0186.69
5.0.40.0050.0176.54
5.0.30.0020.0336.36
5.0.20.0040.0216.33
5.0.10.0030.0196.30
5.0.00.0060.0356.30
4.4.90.0020.0194.78
4.4.80.0030.0154.75
4.4.70.0040.0144.75
4.4.60.0040.0144.76
4.4.50.0020.0174.77
4.4.40.0020.0264.71
4.4.30.0020.0154.76
4.4.20.0030.0144.85
4.4.10.0020.0164.85
4.4.00.0020.0254.76
4.3.110.0050.0154.67
4.3.100.0020.0174.66
4.3.90.0030.0194.63
4.3.80.0000.0274.58
4.3.70.0030.0144.63
4.3.60.0050.0144.63
4.3.50.0030.0154.63
4.3.40.0010.0264.54
4.3.30.0040.0143.32
4.3.20.0030.0153.29
4.3.10.0040.0143.25
4.3.00.0170.0206.91

preferences:
43.21 ms | 401 KiB | 5 Q