3v4l.org

run code in 300+ PHP versions simultaneously
<?php function htmlWrapThing($str, $size, $breaking){ $html = false; $i = 0; $t = 0; $tagcount = 0; $chars = str_split($str); $return = ""; $break = false; $tag = ""; $newtag=""; foreach($chars as $char){ if($char=="<"){ $tagcount++; $html = true; } if($char==">") $html = false; if(($tagcount/2)>0){ $tagcount = 0; $tag = ""; } if($html) $t++; if($html && $char!="/" && $t > 1){ $tag .= $char; $t =0; } if(!$html) $i++; $return .= $char; if($i==$size) $break = true; if($char == " " && !$html && $break){ if(!isset($tag)||$tag==""){ $return .= $breaking; }else{ $return .= '</'.$tag.'>'.$breaking.'<'.$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 />hello everybody how are you doing today?"; echo htmlWrapThing($str,10, "<br><br>");

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.18
8.3.50.0210.00018.10
8.3.40.0070.01118.67
8.3.30.0070.00719.21
8.3.20.0150.00020.29
8.3.10.0040.00423.69
8.3.00.0080.00019.38
8.2.180.0090.01216.38
8.2.170.0040.01122.96
8.2.160.0080.00820.35
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.08
8.2.110.0030.00619.27
8.2.100.0060.00617.72
8.2.90.0040.00419.36
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0040.00418.03
8.2.50.0090.00018.07
8.2.40.0040.00418.22
8.2.30.0060.00318.07
8.2.20.0020.00517.79
8.2.10.0050.00318.13
8.2.00.0040.00417.70
8.1.280.0140.00725.92
8.1.270.0000.00923.92
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00719.13
8.1.230.0040.00717.76
8.1.220.0000.00817.78
8.1.210.0000.00918.77
8.1.200.0040.00417.23
8.1.190.0000.00817.10
8.1.180.0000.00718.10
8.1.170.0000.00818.59
8.1.160.0040.00422.01
8.1.150.0030.00518.96
8.1.140.0000.00717.39
8.1.130.0070.00017.97
8.1.120.0040.00417.51
8.1.110.0050.00317.52
8.1.100.0040.00417.54
8.1.90.0000.00717.48
8.1.80.0000.00717.52
8.1.70.0030.00317.38
8.1.60.0040.00817.61
8.1.50.0050.00317.44
8.1.40.0040.00417.58
8.1.30.0000.00817.73
8.1.20.0060.00317.61
8.1.10.0000.00717.43
8.1.00.0000.00817.37
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0000.00718.42
8.0.270.0000.00717.34
8.0.260.0030.00317.29
8.0.250.0000.00716.93
8.0.240.0070.00017.01
8.0.230.0070.00017.00
8.0.220.0030.00516.91
8.0.210.0030.00317.00
8.0.200.0030.00316.90
8.0.190.0040.00416.99
8.0.180.0030.00616.98
8.0.170.0040.00417.00
8.0.160.0080.00016.98
8.0.150.0000.00716.90
8.0.140.0040.00416.90
8.0.130.0000.00613.32
8.0.120.0080.00016.88
8.0.110.0000.00716.85
8.0.100.0000.00716.89
8.0.90.0040.00416.73
8.0.80.0060.01316.82
8.0.70.0040.00416.75
8.0.60.0070.00016.88
8.0.50.0040.00417.00
8.0.30.0120.00816.92
8.0.20.0120.01017.40
8.0.10.0040.00416.83
8.0.00.0130.00716.83
7.4.330.0000.00515.19
7.4.320.0030.00316.56
7.4.300.0000.00616.45
7.4.290.0030.00616.53
7.4.280.0030.00716.50
7.4.270.0000.00716.55
7.4.260.0030.00516.52
7.4.250.0040.00416.50
7.4.240.0050.00216.47
7.4.230.0000.00716.54
7.4.220.0130.00616.59
7.4.210.0070.01416.72
7.4.200.0030.00316.40
7.4.160.0070.01016.62
7.4.150.0090.00917.40
7.4.140.0090.01317.86
7.4.130.0110.00616.55
7.4.120.0100.00916.57
7.4.110.0140.00316.59
7.4.100.0100.00616.55
7.4.90.0070.01116.32
7.4.80.0070.01019.39
7.4.70.0030.01316.39
7.4.60.0030.01316.29
7.4.50.0030.00616.45
7.4.40.0110.00716.77
7.4.30.0080.00816.66
7.4.00.0050.01015.07
7.3.330.0000.00513.41
7.3.320.0000.00513.48
7.3.310.0070.00016.43
7.3.300.0000.00716.27
7.3.290.0100.00816.42
7.3.280.0100.00616.37
7.3.270.0160.00417.40
7.3.260.0070.01116.47
7.3.250.0100.00916.54
7.3.240.0070.01316.46
7.3.230.0100.00716.41
7.3.210.0000.01616.33
7.3.200.0030.01619.39
7.3.190.0030.01516.45
7.3.180.0130.00316.33
7.3.170.0130.00416.43
7.3.160.0030.01316.44
7.3.120.0100.00314.96
7.3.110.0130.00315.00
7.3.100.0090.00614.82
7.3.90.0040.01414.87
7.3.80.0040.00814.89
7.3.70.0030.01014.95
7.3.60.0060.00914.99
7.3.50.0000.01414.68
7.3.40.0030.01015.02
7.3.30.0030.00614.98
7.3.20.0100.00316.76
7.3.10.0040.00816.60
7.3.00.0070.00616.66
7.2.330.0160.00616.73
7.2.320.0090.00616.82
7.2.310.0000.01616.54
7.2.300.0060.01016.75
7.2.290.0120.00616.50
7.2.250.0090.00914.88
7.2.240.0040.01515.17
7.2.230.0130.00315.02
7.2.220.0140.00415.02
7.2.210.0070.00714.89
7.2.200.0120.00315.16
7.2.190.0090.00914.93
7.2.180.0040.00814.96
7.2.170.0100.00614.80
7.2.130.0070.00716.66
7.2.120.0040.01117.03
7.2.110.0060.00616.58
7.2.100.0020.00916.99
7.2.90.0030.00816.96
7.2.80.0120.00616.66
7.2.70.0080.00816.74
7.2.60.0100.00716.85
7.2.50.0100.00516.76
7.2.40.0110.00516.93
7.2.30.0040.00916.82
7.2.20.0050.00816.98
7.2.10.0060.00616.86
7.2.00.0060.00916.62
7.1.330.0070.00715.86
7.1.320.0000.01315.72
7.1.310.0030.01015.65
7.1.300.0000.01115.75
7.1.290.0100.00315.77
7.1.280.0040.01215.50
7.1.270.0030.00615.74
7.1.260.0030.00715.67
7.1.250.0050.00715.76
7.1.240.0060.01115.61
7.1.230.0030.00615.55
7.1.220.0100.00615.44
7.1.210.0120.00615.96
7.1.200.0000.01215.60
7.1.190.0060.01215.64
7.1.180.0030.01015.90
7.1.170.0040.00715.98
7.1.160.0140.00315.39
7.1.150.0000.01215.93
7.1.140.0060.00915.56
7.1.130.0030.00615.58
7.1.120.0090.00615.58
7.1.110.0030.01215.94
7.1.100.0030.00816.84
7.1.90.0080.00815.43
7.1.80.0150.00315.49
7.1.70.0030.00616.54
7.1.60.0070.01217.58
7.1.50.0110.00516.37
7.1.40.0050.00515.69
7.1.30.0030.01015.59
7.1.20.0110.00715.77
7.1.10.0040.00415.80
7.1.00.0040.04319.07
7.0.330.0070.00715.50
7.0.320.0060.00315.18
7.0.310.0000.00815.23
7.0.300.0040.01115.13
7.0.290.0000.01715.17
7.0.280.0030.00915.08
7.0.270.0070.00315.22
7.0.260.0040.00814.96
7.0.250.0080.00415.25
7.0.240.0040.01115.35
7.0.230.0070.00715.23
7.0.220.0030.00615.03
7.0.210.0030.01015.14
7.0.200.0050.01015.90
7.0.190.0040.01115.52
7.0.180.0210.00415.39
7.0.170.0030.00615.35
7.0.160.0090.00315.20
7.0.150.0030.00914.99
7.0.140.0070.03818.56
7.0.130.0060.00315.42
7.0.120.0040.01215.23
7.0.110.0030.00515.39
7.0.100.0030.00915.11
7.0.90.0000.01215.38
7.0.80.0050.00515.03
7.0.70.0070.00715.39
7.0.60.0060.02217.57
7.0.50.0070.02116.62
7.0.40.0070.03116.83
7.0.30.0280.04016.86
7.0.20.0200.04216.69
7.0.10.0080.03816.71
7.0.00.0030.02416.78
5.6.380.0030.01014.23
5.6.370.0030.01214.62
5.6.360.0030.01414.26
5.6.350.0080.00814.10
5.6.340.0050.01014.39
5.6.330.0180.00414.59
5.6.320.0040.01913.95
5.6.310.0110.00414.64
5.6.300.0000.01414.38
5.6.290.0080.00813.92
5.6.280.0090.03717.49
5.6.270.0100.00714.21
5.6.260.0150.00314.53
5.6.250.0110.00014.42
5.6.240.0040.01114.12
5.6.230.0030.01214.19
5.6.220.0000.01114.49
5.6.210.0130.03117.45
5.6.200.0150.03416.30
5.6.190.0030.03017.54
5.6.180.0130.02417.38
5.6.170.0180.03817.34
5.6.160.0060.02817.47
5.6.150.0090.04016.32
5.6.140.0030.03516.41
5.6.130.0050.05016.30
5.6.120.0080.04317.64
5.6.110.0110.03817.77
5.6.100.0100.04317.74
5.6.90.0050.02517.62
5.6.80.0070.04317.40
5.6.70.0040.04417.37
5.6.60.0040.00714.37
5.6.50.0070.00714.40
5.6.40.0060.00614.21
5.6.30.0070.00714.14
5.6.20.0040.00814.30
5.6.10.0110.00414.19
5.6.00.0040.00414.23
5.5.380.0050.00511.11
5.5.370.0000.01311.46
5.5.360.0040.00411.13
5.5.350.0150.03715.73
5.5.340.0070.01714.63
5.5.330.0070.03915.80
5.5.320.0150.04615.82
5.5.310.0100.02415.86
5.5.300.0090.03114.65
5.5.290.0050.03614.64
5.5.280.0100.04015.98
5.5.270.0020.02415.98
5.5.260.0050.04216.08
5.5.250.0050.02215.97
5.5.240.2170.01815.54
5.5.230.0000.01111.41
5.5.220.0060.00610.94
5.5.210.0070.00310.93
5.5.200.0000.01011.12
5.5.190.0060.00611.03
5.5.180.0000.00910.91
5.5.170.0000.00811.16
5.5.160.0040.00810.76
5.5.150.0060.00610.63
5.5.140.0000.01310.83
5.5.130.0000.01010.63
5.5.120.0070.00411.21
5.5.110.0080.00411.07
5.5.100.0040.00410.89
5.5.90.0000.01310.94
5.5.80.0050.00311.13
5.5.70.0050.00310.88
5.5.60.0070.00411.25
5.5.50.0040.00811.31
5.5.40.0060.00311.09
5.5.30.0030.00911.23
5.5.20.0060.00311.19
5.5.10.0000.00911.13
5.5.00.0030.00710.87
5.4.450.0470.02515.20
5.4.440.0410.02915.20
5.4.430.0070.03715.28
5.4.420.0120.02415.27
5.4.410.0410.03115.19
5.4.400.0230.03114.91
5.4.390.0140.03815.25
5.4.380.0350.03115.01
5.4.370.0480.04315.02
5.4.360.0330.03114.88
5.4.350.0300.03115.17
5.4.340.0050.02111.43
5.4.330.0070.00411.35
5.4.320.0040.02311.79
5.4.310.0040.02211.89
5.4.300.0070.02011.73
5.4.290.0040.02411.65
5.4.280.0020.02311.59
5.4.270.0070.02011.69
5.4.260.0020.02311.63
5.4.250.0040.02311.78
5.4.240.0040.02311.77
5.4.230.0050.02111.74
5.4.220.0030.02211.79
5.4.210.0050.02211.72
5.4.200.0060.02311.74
5.4.190.0080.01711.84
5.4.180.0050.02311.64
5.4.170.0070.02111.71
5.4.160.0020.02511.84
5.4.150.0050.02111.71
5.4.140.0050.02211.57
5.4.130.0080.01911.50
5.4.120.0090.01711.68
5.4.110.0050.02211.58
5.4.100.0040.02211.57
5.4.90.0060.02111.58
5.4.80.0050.02311.54
5.4.70.0050.02011.62
5.4.60.0050.02411.52
5.4.50.0040.02211.55
5.4.40.0020.02411.53
5.4.30.0040.02211.56
5.4.20.0060.02111.41
5.4.10.0060.01911.52
5.4.00.0070.01911.12
5.3.290.0060.02011.80
5.3.280.0070.02211.68
5.3.270.0040.02411.57
5.3.260.0070.02411.70
5.3.250.0090.01711.78
5.3.240.0040.02211.66
5.3.230.0040.02311.70
5.3.220.0030.02211.55
5.3.210.0040.02311.67
5.3.200.0030.02411.59
5.3.190.0070.01911.63
5.3.180.0040.02111.55
5.3.170.0060.02111.62
5.3.160.0030.02211.63
5.3.150.0040.02311.59
5.3.140.0100.01811.67
5.3.130.0060.02311.60
5.3.120.0040.02311.66
5.3.110.0020.02711.60
5.3.100.0060.01911.29
5.3.90.0050.02211.31
5.3.80.0080.02511.35
5.3.70.0050.02311.33
5.3.60.0060.02211.43
5.3.50.0040.02311.17
5.3.40.0020.02411.25
5.3.30.0030.02511.33
5.3.20.0050.02011.22
5.3.10.0040.02011.09
5.3.00.0030.02411.06
5.2.170.0040.0199.66
5.2.160.0070.0179.66
5.2.150.0070.0159.67
5.2.140.0020.0229.66
5.2.130.0040.0189.64
5.2.120.0040.0219.64
5.2.110.0020.0209.64
5.2.100.0020.0219.64
5.2.90.0030.0179.64
5.2.80.0040.0199.64
5.2.70.0020.0209.64
5.2.60.0040.0199.62
5.2.50.0020.0209.60
5.2.40.0040.0199.59
5.2.30.0020.0189.58
5.2.20.0040.0209.57
5.2.10.0050.0169.53
5.2.00.0050.0169.46
5.1.60.0040.0139.10
5.1.50.0030.0169.10
5.1.40.0050.0159.09
5.1.30.0010.0179.27
5.1.20.0050.0169.28
5.1.10.0040.0189.14
5.1.00.0040.0159.14
5.0.50.0040.0108.38
5.0.40.0020.0148.31
5.0.30.0020.0228.22
5.0.20.0030.0138.20
5.0.10.0050.0128.19
5.0.00.0040.0198.20
4.4.90.0020.0107.42
4.4.80.0020.0107.41
4.4.70.0050.0077.41
4.4.60.0040.0077.41
4.4.50.0010.0107.42
4.4.40.0040.0137.39
4.4.30.0020.0117.41
4.4.20.0040.0097.46
4.4.10.0010.0167.46
4.4.00.0030.0177.41
4.3.110.0050.0107.37
4.3.100.0030.0137.37
4.3.90.0010.0127.35
4.3.80.0040.0127.32
4.3.70.0010.0117.35
4.3.60.0010.0107.35
4.3.50.0020.0107.35
4.3.40.0030.0137.30
4.3.30.0010.0116.69
4.3.20.0010.0116.69
4.3.10.0010.0116.66
4.3.00.0080.0118.43

preferences:
52.57 ms | 400 KiB | 5 Q