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; $oldtag = $tag; if($oldtag != $tag){ $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.60.0070.00718.56
8.3.50.0260.01021.92
8.3.40.0090.00618.79
8.3.30.0100.00319.03
8.3.20.0070.00020.15
8.3.10.0030.01223.65
8.3.00.0090.00019.51
8.2.180.0140.00316.88
8.2.170.0090.00622.96
8.2.160.0040.01120.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.86
8.2.110.0040.00421.00
8.2.100.0040.00817.91
8.2.90.0050.00318.15
8.2.80.0000.00817.97
8.2.70.0090.00017.63
8.2.60.0030.00617.93
8.2.50.0030.00518.07
8.2.40.0060.00318.34
8.2.30.0040.00418.16
8.2.20.0040.00417.98
8.2.10.0040.00418.15
8.2.00.0040.00417.79
8.1.280.0110.01125.92
8.1.270.0070.00323.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00522.51
8.1.230.0060.00621.04
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0060.00617.25
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0000.00818.64
8.1.160.0000.00821.97
8.1.150.0000.00818.97
8.1.140.0000.00717.58
8.1.130.0040.00417.93
8.1.120.0030.00417.48
8.1.110.0070.00017.58
8.1.100.0000.00717.51
8.1.90.0000.00817.39
8.1.80.0030.00317.43
8.1.70.0070.00017.45
8.1.60.0040.00417.54
8.1.50.0080.00017.61
8.1.40.0000.00817.55
8.1.30.0080.00017.71
8.1.20.0040.00417.57
8.1.10.0040.00417.55
8.1.00.0040.00417.52
8.0.300.0060.00319.91
8.0.290.0070.00016.75
8.0.280.0070.00018.56
8.0.270.0070.00017.30
8.0.260.0000.00617.28
8.0.250.0070.00017.09
8.0.240.0040.00417.05
8.0.230.0040.00417.09
8.0.220.0000.00717.00
8.0.210.0060.00016.90
8.0.200.0000.00617.08
8.0.190.0080.00017.04
8.0.180.0070.00017.01
8.0.170.0030.00617.06
8.0.160.0070.00017.08
8.0.150.0040.00416.93
8.0.140.0040.00416.95
8.0.130.0060.00013.43
8.0.120.0000.00916.95
8.0.110.0050.00316.99
8.0.100.0020.00516.95
8.0.90.0070.00016.90
8.0.80.0060.00916.96
8.0.70.0040.00416.90
8.0.60.0040.00416.88
8.0.50.0040.00416.91
8.0.30.0120.01216.94
8.0.20.0150.00417.40
8.0.10.0000.00717.00
8.0.00.0110.01017.01
7.4.330.0050.00015.02
7.4.320.0000.00716.67
7.4.300.0060.00016.63
7.4.290.0000.00716.68
7.4.280.0030.00516.56
7.4.270.0070.00016.60
7.4.260.0040.00416.54
7.4.250.0000.00716.64
7.4.240.0040.00316.51
7.4.230.0030.00516.68
7.4.220.0140.00316.68
7.4.210.0040.01116.61
7.4.200.0000.00816.75
7.4.160.0130.00316.62
7.4.150.0140.00317.40
7.4.140.0140.00717.86
7.4.130.0140.00316.65
7.4.120.0100.00816.54
7.4.110.0100.01016.57
7.4.100.0110.00616.61
7.4.90.0110.00716.70
7.4.80.0090.01019.39
7.4.70.0070.01016.56
7.4.60.0100.00716.67
7.4.50.0040.00016.34
7.4.40.0070.01016.46
7.4.30.0160.00716.61
7.4.10.0070.01114.96
7.4.00.0100.00914.93
7.3.330.0050.00013.34
7.3.320.0050.00013.41
7.3.310.0070.00016.51
7.3.300.0070.00016.49
7.3.290.0040.01116.46
7.3.280.0120.00516.47
7.3.270.0080.01217.40
7.3.260.0120.00616.65
7.3.250.0110.00616.54
7.3.240.0110.00516.47
7.3.230.0090.01016.49
7.3.210.0080.00816.67
7.3.200.0100.01019.39
7.3.190.0130.00316.44
7.3.180.0060.00916.48
7.3.170.0060.00916.46
7.3.160.0100.00616.61
7.3.130.0080.01114.86
7.3.120.0060.01114.70
7.3.110.0070.01115.16
7.3.100.0040.00814.86
7.3.90.0030.01014.97
7.3.80.0030.01415.16
7.3.70.0040.00414.70
7.3.60.0080.00814.82
7.3.50.0080.00814.86
7.3.40.0040.01114.53
7.3.30.0060.00914.87
7.3.20.0100.00516.23
7.3.10.0070.00716.62
7.3.00.0070.00716.66
7.2.330.0100.00716.73
7.2.320.0110.00616.55
7.2.310.0030.01416.66
7.2.300.0130.00416.81
7.2.290.0150.00916.59
7.2.260.0120.00615.09
7.2.250.0040.01515.11
7.2.240.0060.00915.24
7.2.230.0110.00415.32
7.2.220.0070.00315.09
7.2.210.0030.01314.74
7.2.200.0000.01215.27
7.2.190.0110.00714.70
7.2.180.0150.00015.02
7.2.170.0030.01015.02
7.2.160.0000.01414.83
7.2.150.0030.00916.75
7.2.140.0060.00916.87
7.2.130.0070.00716.72
7.2.120.0000.01416.65
7.2.110.0050.00816.61
7.2.100.0120.00316.52
7.2.90.0100.00316.70
7.2.80.0080.00716.57
7.2.70.0060.00816.90
7.2.60.0030.01116.91
7.2.50.0060.00916.77
7.2.40.0070.00716.84
7.2.30.0050.01117.00
7.2.20.0060.01116.83
7.2.10.0040.01116.82
7.2.00.0100.00517.75
7.1.330.0040.01115.60
7.1.320.0040.00415.81
7.1.310.0030.00615.62
7.1.300.0070.00715.61
7.1.290.0030.00915.76
7.1.280.0100.00715.48
7.1.270.0120.00415.93
7.1.260.0040.00715.67
7.1.250.0000.01015.37
7.1.240.0060.00615.73
7.1.230.0050.00915.75
7.1.220.0040.01015.65
7.1.210.0050.01015.79
7.1.200.0070.00515.86
7.1.190.0020.01015.56
7.1.180.0080.00315.79
7.1.170.0050.00815.75
7.1.160.0000.01215.80
7.1.150.0100.00515.71
7.1.140.0110.00315.76
7.1.130.0030.00715.82
7.1.120.0090.00515.74
7.1.110.0030.01215.67
7.1.100.0090.00516.58
7.1.90.0050.01015.65
7.1.80.0060.00615.75
7.1.70.0070.00416.31
7.1.60.0090.00516.92
7.1.50.0080.01016.14
7.1.40.0030.00715.83
7.1.30.0060.00515.58
7.1.20.0050.00915.86
7.1.10.0070.00715.83
7.1.00.0050.03017.93
7.0.330.0070.00715.20
7.0.320.0060.00915.20
7.0.310.0050.00715.28
7.0.300.0060.00415.33
7.0.290.0040.00915.31
7.0.280.0080.00615.44
7.0.270.0050.00615.43
7.0.260.0040.00815.17
7.0.250.0030.01015.48
7.0.240.0090.00415.37
7.0.230.0030.01115.42
7.0.220.0080.00715.53
7.0.210.0070.00715.34
7.0.200.0010.00915.86
7.0.190.0030.00715.49
7.0.180.0050.00515.32
7.0.170.0050.00715.43
7.0.160.0000.01315.52
7.0.150.0070.00715.44
7.0.140.0010.03217.53
7.0.130.0080.00415.38
7.0.120.0020.01115.33
7.0.110.0020.00815.55
7.0.100.0080.00515.38
7.0.90.0090.00515.51
7.0.80.0070.00715.54
7.0.70.0030.01215.42
7.0.60.0090.03316.99
7.0.50.0050.01616.35
7.0.40.0060.02015.71
7.0.30.0210.02515.75
7.0.20.0140.02115.68
7.0.10.0020.02215.75
7.0.00.0060.02715.74
5.6.400.0030.01014.49
5.6.390.0040.01114.43
5.6.380.0030.00914.24
5.6.370.0020.00914.59
5.6.360.0120.00314.37
5.6.350.0070.00814.77
5.6.340.0060.00614.32
5.6.330.0050.00814.47
5.6.320.0080.00514.56
5.6.310.0030.01214.56
5.6.300.0040.00914.37
5.6.290.0030.00514.45
5.6.280.0070.02816.62
5.6.270.0090.00514.52
5.6.260.0090.00614.68
5.6.250.0060.00914.54
5.6.240.0020.00714.45
5.6.230.0070.00714.33
5.6.220.0110.00514.48
5.6.210.0070.03216.53
5.6.200.0060.03515.64
5.6.190.0050.03816.52
5.6.180.0080.02216.45
5.6.170.0120.02016.36
5.6.160.0050.02316.44
5.6.150.0060.01715.63
5.6.140.0080.03015.77
5.6.130.0060.03215.62
5.6.120.0120.02216.72
5.6.110.0060.01916.67
5.6.100.0040.01916.90
5.6.90.0070.03216.64
5.6.80.0060.03016.45
5.6.70.0010.00914.10
5.6.60.0040.00914.36
5.6.50.0050.00914.51
5.6.40.0050.00614.23
5.6.30.0050.00914.25
5.6.20.0110.00414.25
5.6.10.0090.00714.37
5.6.00.0020.01114.38
5.5.380.0040.00812.89
5.5.370.0060.00812.70
5.5.360.0050.00812.74
5.5.350.1480.01415.17
5.5.340.0070.01614.42
5.5.330.0020.02315.37
5.5.320.0110.02115.30
5.5.310.0120.01615.28
5.5.300.0080.02414.54
5.5.290.0050.01914.54
5.5.280.0040.03215.46
5.5.270.0040.02015.46
5.5.260.0020.03315.47
5.5.250.0110.02215.51
5.5.240.0140.02615.15
5.5.230.0030.00812.83
5.5.220.0020.00712.86
5.5.210.0040.00812.82
5.5.200.0050.00712.91
5.5.190.0040.00912.79
5.5.180.0050.00712.64
5.5.170.0040.01014.37
5.5.160.0070.00312.58
5.5.150.0090.00212.68
5.5.140.0000.01212.80
5.5.130.0050.00612.92
5.5.120.0000.01312.84
5.5.110.0050.00512.80
5.5.100.0030.00812.58
5.5.90.0030.00712.67
5.5.80.0030.00912.67
5.5.70.0040.00712.67
5.5.60.0050.00712.67
5.5.50.0020.00712.60
5.5.40.0030.01012.57
5.5.30.0060.00612.66
5.5.20.0040.01012.54
5.5.10.0060.00812.93
5.5.00.0070.00412.88
5.4.450.0350.02913.97
5.4.440.0330.02113.95
5.4.430.0220.02613.99
5.4.420.0060.02313.93
5.4.410.0240.02313.86
5.4.400.0360.01513.89
5.4.390.0280.02513.67
5.4.380.0330.01913.77
5.4.370.0330.02613.83
5.4.360.0360.01813.77
5.4.350.0150.02713.92
5.4.340.0030.01711.42
5.4.330.0030.00811.10
5.4.320.0040.01611.63
5.4.310.0050.01711.50
5.4.300.0030.02011.57
5.4.290.0050.01611.55
5.4.280.0040.01811.59
5.4.270.0030.01711.55
5.4.260.0030.01911.60
5.4.250.0050.01711.51
5.4.240.0050.01611.49
5.4.230.0050.01611.61
5.4.220.0050.01611.52
5.4.210.0060.01411.39
5.4.200.0030.01711.47
5.4.190.0080.01411.60
5.4.180.0080.01411.55
5.4.170.0040.01611.48
5.4.160.0060.01511.44
5.4.150.0080.01411.55
5.4.140.0050.01911.54
5.4.130.0020.01711.46
5.4.120.0050.01511.33
5.4.110.0070.01411.43
5.4.100.0070.01711.59
5.4.90.0050.01611.45
5.4.80.0070.01511.38
5.4.70.0060.01811.50
5.4.60.0050.01511.47
5.4.50.0060.01411.38
5.4.40.0040.01611.43
5.4.30.0070.01411.40
5.4.20.0050.01411.33
5.4.10.0090.01411.40
5.4.00.0020.01811.31
5.3.290.0030.02411.94
5.3.280.0020.02511.89
5.3.270.0040.02211.90
5.3.260.0020.02511.90
5.3.250.0050.02011.90
5.3.240.0060.02111.90
5.3.230.0040.02211.90
5.3.220.0050.02211.88
5.3.210.0060.02211.88
5.3.200.0050.02111.88
5.3.190.0050.02011.88
5.3.180.0040.02211.88
5.3.170.0050.01911.88
5.3.160.0020.02411.88
5.3.150.0060.01911.88
5.3.140.0060.01811.87
5.3.130.0050.02211.87
5.3.120.0020.02511.87
5.3.110.0070.02011.87
5.3.100.0040.02111.61
5.3.90.0030.02211.61
5.3.80.0070.02011.60
5.3.70.0040.02111.60
5.3.60.0020.02511.60
5.3.50.0050.02311.57
5.3.40.0080.02111.57
5.3.30.0090.01811.55
5.3.20.0040.01911.44
5.3.10.0050.01911.42
5.3.00.0050.02011.42
5.2.170.0050.01610.17
5.2.160.0050.01910.17
5.2.150.0040.01910.17
5.2.140.0040.01710.16
5.2.130.0040.01610.15
5.2.120.0040.01710.15
5.2.110.0040.02110.15
5.2.100.0050.02010.15
5.2.90.0040.02210.15
5.2.80.0030.02110.14
5.2.70.0050.01710.14
5.2.60.0040.01710.12
5.2.50.0020.01910.11
5.2.40.0040.01710.09
5.2.30.0040.02010.08
5.2.20.0060.01910.07
5.2.10.0040.01510.03
5.2.00.0040.0179.96
5.1.60.0040.0179.60
5.1.50.0030.0139.60
5.1.40.0060.0159.59
5.1.30.0060.0159.77
5.1.20.0080.0129.78
5.1.10.0040.0149.64
5.1.00.0060.0129.64
5.0.50.0020.0138.88
5.0.40.0050.0108.81
5.0.30.0070.0148.72
5.0.20.0050.0138.71
5.0.10.0050.0108.69
5.0.00.0050.0178.70
4.4.90.0030.0117.93
4.4.80.0020.0107.92
4.4.70.0030.0087.92
4.4.60.0010.0117.92
4.4.50.0010.0117.92
4.4.40.0020.0147.89
4.4.30.0010.0117.92
4.4.20.0020.0097.96
4.4.10.0040.0087.96
4.4.00.0010.0157.92
4.3.110.0010.0137.87
4.3.100.0010.0117.87
4.3.90.0030.0087.86
4.3.80.0010.0157.83
4.3.70.0010.0097.85
4.3.60.0040.0097.85
4.3.50.0020.0127.85
4.3.40.0030.0127.81
4.3.30.0010.0097.20
4.3.20.0010.0107.18
4.3.10.0030.0087.17
4.3.00.0040.0208.92

preferences:
47.49 ms | 401 KiB | 5 Q