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; $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.0060.01018.56
8.3.50.0160.00821.11
8.3.40.0040.01118.79
8.3.30.0150.00019.22
8.3.20.0070.00020.34
8.3.10.0040.01123.71
8.3.00.0040.00419.38
8.2.180.0090.00918.67
8.2.170.0110.00422.96
8.2.160.0040.01120.22
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00320.89
8.2.110.0090.00022.27
8.2.100.0090.00317.88
8.2.90.0020.00519.29
8.2.80.0040.00417.97
8.2.70.0060.00617.75
8.2.60.0030.00717.93
8.2.50.0050.00318.07
8.2.40.0040.00418.16
8.2.30.0000.00718.23
8.2.20.0000.00917.92
8.2.10.0080.00018.28
8.2.00.0040.00417.76
8.1.280.0100.00625.92
8.1.270.0060.00323.92
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0040.00423.84
8.1.230.0030.00719.17
8.1.220.0050.00317.79
8.1.210.0000.00818.77
8.1.200.0070.00517.25
8.1.190.0030.00617.23
8.1.180.0050.00318.10
8.1.170.0080.00018.71
8.1.160.0040.00421.98
8.1.150.0020.00518.81
8.1.140.0040.00417.53
8.1.130.0000.00817.87
8.1.120.0000.00717.40
8.1.110.0040.00417.49
8.1.100.0030.00517.53
8.1.90.0030.00517.51
8.1.80.0040.00417.56
8.1.70.0000.00717.47
8.1.60.0040.00417.59
8.1.50.0040.00417.59
8.1.40.0030.00617.55
8.1.30.0030.00517.61
8.1.20.0040.00417.71
8.1.10.0040.00417.46
8.1.00.0050.00317.47
8.0.300.0000.00818.77
8.0.290.0070.00016.88
8.0.280.0040.00418.55
8.0.270.0040.00416.80
8.0.260.0000.00617.32
8.0.250.0000.00717.05
8.0.240.0000.00717.09
8.0.230.0000.00717.03
8.0.220.0000.00716.94
8.0.210.0030.00316.89
8.0.200.0000.00716.93
8.0.190.0050.00317.08
8.0.180.0030.00517.01
8.0.170.0000.00816.89
8.0.160.0000.00716.91
8.0.150.0040.00417.05
8.0.140.0000.00817.00
8.0.130.0030.00313.39
8.0.120.0000.00816.82
8.0.110.0000.00816.84
8.0.100.0000.00716.91
8.0.90.0000.00716.88
8.0.80.0120.01016.98
8.0.70.0000.00716.91
8.0.60.0070.00016.81
8.0.50.0040.00416.99
8.0.30.0130.00917.23
8.0.20.0060.01417.40
8.0.10.0000.00717.09
8.0.00.0170.00516.89
7.4.330.0000.00615.02
7.4.320.0030.00316.57
7.4.300.0000.00716.46
7.4.290.0000.00716.64
7.4.280.0070.00016.49
7.4.270.0030.00316.57
7.4.260.0030.00516.40
7.4.250.0000.00716.42
7.4.240.0040.00416.60
7.4.230.0030.00316.46
7.4.220.0070.01016.69
7.4.210.0070.00716.65
7.4.200.0030.00316.67
7.4.160.0050.01116.71
7.4.150.0180.00617.40
7.4.140.0120.00817.86
7.4.130.0090.00916.58
7.4.120.0050.01216.46
7.4.110.0120.00616.41
7.4.100.0090.00816.67
7.4.90.0090.01016.62
7.4.80.0140.00419.39
7.4.70.0030.01316.63
7.4.60.0060.00916.46
7.4.50.0030.00616.61
7.4.40.0090.00616.62
7.4.30.0070.01016.68
7.4.10.0030.01715.29
7.4.00.0060.01215.01
7.3.330.0020.00213.46
7.3.320.0050.00013.35
7.3.310.0000.00816.38
7.3.300.0030.00316.52
7.3.290.0070.00716.46
7.3.280.0090.00816.52
7.3.270.0110.00717.40
7.3.260.0060.01216.52
7.3.250.0120.00516.60
7.3.240.0060.01116.48
7.3.230.0080.00816.45
7.3.210.0050.01116.69
7.3.200.0090.01219.39
7.3.190.0090.00616.48
7.3.180.0070.00816.53
7.3.170.0180.00316.46
7.3.160.0140.00316.59
7.3.130.0190.00015.08
7.3.120.0050.01115.04
7.3.110.0090.01014.94
7.3.100.0110.00614.95
7.3.90.0080.00514.80
7.3.80.0040.00914.94
7.3.70.0050.01014.88
7.3.60.0030.01614.87
7.3.50.0090.00414.97
7.3.40.0060.00614.67
7.3.30.0070.00514.89
7.3.20.0030.01216.85
7.3.10.0090.00516.68
7.3.00.0050.00616.67
7.2.330.0150.00416.61
7.2.320.0130.00616.90
7.2.310.0080.00816.83
7.2.300.0060.01116.89
7.2.290.0130.01016.78
7.2.260.0120.00314.91
7.2.250.0050.01315.07
7.2.240.0030.01315.19
7.2.230.0060.01115.20
7.2.220.0070.01215.21
7.2.210.0050.00915.01
7.2.200.0020.00915.01
7.2.190.0030.01014.89
7.2.180.0040.01615.09
7.2.170.0070.00915.24
7.2.160.0010.01115.08
7.2.150.0040.01316.85
7.2.140.0040.01016.79
7.2.130.0090.00617.02
7.2.120.0060.00716.99
7.2.110.0060.00916.89
7.2.100.0070.01016.97
7.2.90.0090.00616.80
7.2.80.0060.00916.97
7.2.70.0050.01017.01
7.2.60.0070.00916.98
7.2.50.0080.00716.91
7.2.40.0060.01016.85
7.2.30.0080.00716.93
7.2.20.0060.00916.92
7.2.10.0080.00616.90
7.2.00.0080.00616.91
7.1.330.0090.00615.91
7.1.320.0090.00615.75
7.1.310.0060.00615.99
7.1.300.0070.01015.82
7.1.290.0060.00815.72
7.1.280.0050.00915.80
7.1.270.0060.00815.72
7.1.260.0060.00415.78
7.1.250.0090.00515.91
7.1.240.0060.00715.71
7.1.230.0050.00815.81
7.1.220.0050.00815.80
7.1.210.0080.00615.78
7.1.200.0050.00915.92
7.1.190.0090.00815.70
7.1.180.0070.00915.75
7.1.170.0070.00615.61
7.1.160.0110.00515.67
7.1.150.0070.00615.80
7.1.140.0120.00215.85
7.1.130.0050.01215.86
7.1.120.0100.00415.86
7.1.110.0110.00615.75
7.1.100.0090.00715.90
7.1.90.0050.01015.80
7.1.80.0050.01015.74
7.1.70.0080.00615.91
7.1.60.0080.01016.70
7.1.50.0080.00916.08
7.1.40.0060.00815.91
7.1.30.0060.01015.74
7.1.20.0080.00415.78
7.1.10.0100.00515.66
7.1.00.0070.02617.38
7.0.330.0070.00515.53
7.0.320.0080.00615.37
7.0.310.0090.00715.41
7.0.300.0080.00715.52
7.0.290.0080.00815.42
7.0.280.0070.00915.42
7.0.270.0110.00515.42
7.0.260.0080.00515.41
7.0.250.0050.00915.45
7.0.240.0070.00815.52
7.0.230.0050.00915.42
7.0.220.0060.00815.39
7.0.210.0060.00715.43
7.0.200.0070.00715.66
7.0.190.0100.00615.49
7.0.180.0030.01015.39
7.0.170.0080.00815.51
7.0.160.0100.00815.25
7.0.150.0110.00615.44
7.0.140.0050.02516.98
7.0.130.0040.01015.39
7.0.120.0080.00715.53
7.0.110.0100.00415.38
7.0.100.0100.00615.38
7.0.90.0080.00915.43
7.0.80.0040.01215.35
7.0.70.0130.00415.22
7.0.60.0080.02116.50
7.0.50.0090.01216.11
7.0.40.0090.02515.17
7.0.30.0140.02215.05
7.0.20.0140.01315.12
7.0.10.0070.01615.05
7.0.00.0090.02115.10
5.6.400.0090.00314.65
5.6.390.0080.00614.30
5.6.380.0060.00814.68
5.6.370.0040.01114.41
5.6.360.0060.00814.39
5.6.350.0040.01014.38
5.6.340.0080.00614.72
5.6.330.0030.01014.26
5.6.320.0070.00814.50
5.6.310.0070.00914.58
5.6.300.0080.01014.36
5.6.290.0100.00814.52
5.6.280.0060.02716.04
5.6.270.0130.00914.48
5.6.260.0070.00914.53
5.6.250.0070.00814.52
5.6.240.0020.01214.47
5.6.230.0120.00614.41
5.6.220.0040.01014.35
5.6.210.0090.01715.99
5.6.200.0020.01815.39
5.6.190.0070.02616.02
5.6.180.0110.02116.07
5.6.170.0110.02915.86
5.6.160.0080.02516.08
5.6.150.0060.01515.41
5.6.140.0120.01615.34
5.6.130.0060.02215.33
5.6.120.0070.02616.12
5.6.110.0140.02416.07
5.6.100.0090.01416.06
5.6.90.0100.02616.15
5.6.80.0100.02515.93
5.6.70.1200.01515.94
5.6.60.0080.00614.38
5.6.50.0110.00514.54
5.6.40.0140.00514.32
5.6.30.0080.00714.31
5.6.20.0100.00714.46
5.6.10.0090.00714.26
5.6.00.0120.00614.28
5.5.380.0050.00813.31
5.5.370.0070.00513.48
5.5.360.0040.01013.34
5.5.350.0130.01914.94
5.5.340.0060.01914.40
5.5.330.0050.02415.09
5.5.320.0110.02115.10
5.5.310.0100.02415.10
5.5.300.0060.02914.65
5.5.290.0090.02314.47
5.5.280.0060.01515.15
5.5.270.0060.02715.10
5.5.260.0090.02215.13
5.5.250.0090.02415.21
5.5.240.0870.01414.85
5.5.230.0080.00713.16
5.5.220.0080.00713.28
5.5.210.0120.00613.25
5.5.200.0100.00613.41
5.5.190.0070.00613.29
5.5.180.0120.00413.25
5.5.170.0060.00813.28
5.5.160.0120.00513.19
5.5.150.0130.00413.38
5.5.140.0070.00513.28
5.5.130.0080.01013.40
5.5.120.0010.01013.38
5.5.110.0080.00713.36
5.5.100.0060.00913.30
5.5.90.0060.01013.36
5.5.80.0070.00613.08
5.5.70.0020.01113.37
5.5.60.0040.00813.09
5.5.50.0040.00613.23
5.5.40.0020.00913.22
5.5.30.0090.00813.35
5.5.20.0060.00713.35
5.5.10.0050.00913.30
5.5.00.0040.00813.25
5.4.450.0110.02113.66
5.4.440.0240.01713.82
5.4.430.0220.01713.66
5.4.420.0210.02113.70
5.4.410.0110.02213.76
5.4.400.0320.02013.58
5.4.390.0180.02313.67
5.4.380.0220.02113.58
5.4.370.0320.01913.59
5.4.360.0220.01713.51
5.4.350.0250.01613.64
5.4.340.0070.01211.81
5.4.330.0060.00911.61
5.4.320.0040.01311.87
5.4.310.0050.01411.94
5.4.300.0070.01211.89
5.4.290.0060.01311.83
5.4.280.0070.01411.93
5.4.270.0040.01611.91
5.4.260.0060.01611.94
5.4.250.0070.01311.85
5.4.240.0050.01411.85
5.4.230.0060.01411.97
5.4.220.0070.01411.91
5.4.210.0070.00911.87
5.4.200.0040.01211.80
5.4.190.0040.01411.98
5.4.180.0080.01211.89
5.4.170.0060.01411.89
5.4.160.0070.01111.88
5.4.150.0070.01111.80
5.4.140.0060.01311.79
5.4.130.0040.01411.80
5.4.120.0040.01511.85
5.4.110.0030.01611.67
5.4.100.0060.01511.76
5.4.90.0040.01611.82
5.4.80.0070.01411.85
5.4.70.0050.01611.87
5.4.60.0050.01411.68
5.4.50.0030.01411.84
5.4.40.0030.01411.77
5.4.30.0030.01511.84
5.4.20.0070.01311.80
5.4.10.0050.01611.83
5.4.00.0050.01511.64
5.3.290.0090.02311.85
5.3.280.0080.02011.59
5.3.270.0050.02311.73
5.3.260.0080.02111.57
5.3.250.0070.02211.75
5.3.240.0040.02511.66
5.3.230.0030.02611.60
5.3.220.0110.01811.52
5.3.210.0060.02311.65
5.3.200.0020.02511.62
5.3.190.0090.01911.67
5.3.180.0110.01611.75
5.3.170.0040.02811.65
5.3.160.0090.02011.76
5.3.150.0100.01911.67
5.3.140.0060.02011.63
5.3.130.0070.01911.75
5.3.120.0030.02611.75
5.3.110.0050.02111.58
5.3.100.0040.02211.44
5.3.90.0020.02311.39
5.3.80.0060.01911.27
5.3.70.0040.02011.41
5.3.60.0060.02011.40
5.3.50.0050.01911.41
5.3.40.0080.02111.35
5.3.30.0060.02011.24
5.3.20.0060.02211.23
5.3.10.0050.02311.11
5.3.00.0140.01510.97
5.2.170.0020.0189.39
5.2.160.0040.0169.47
5.2.150.0070.0159.37
5.2.140.0080.0189.36
5.2.130.0060.0159.39
5.2.120.0070.0159.39
5.2.110.0040.0189.42
5.2.100.0060.0169.40
5.2.90.0030.0179.40
5.2.80.0060.0179.38
5.2.70.0040.0189.35
5.2.60.0040.0189.30
5.2.50.0040.0179.24
5.2.40.0050.0149.23
5.2.30.0040.0179.30
5.2.20.0040.0169.22
5.2.10.0080.0159.17
5.2.00.0030.0179.10
5.1.60.0040.0148.74
5.1.50.0060.0148.74
5.1.40.0030.0168.73
5.1.30.0040.0148.91
5.1.20.0030.0158.92
5.1.10.0060.0198.78
5.1.00.0040.0158.78
5.0.50.0050.0118.02
5.0.40.0040.0117.95
5.0.30.0040.0197.86
5.0.20.0030.0127.84
5.0.10.0050.0137.83
5.0.00.0050.0167.83
4.4.90.0030.0087.06
4.4.80.0030.0117.05
4.4.70.0050.0107.05
4.4.60.0030.0087.05
4.4.50.0030.0107.06
4.4.40.0040.0157.03
4.4.30.0040.0077.05
4.4.20.0010.0107.10
4.4.10.0050.0087.10
4.4.00.0050.0127.06
4.3.110.0020.0097.01
4.3.100.0030.0097.01
4.3.90.0040.0096.99
4.3.80.0050.0136.97
4.3.70.0040.0076.99
4.3.60.0030.0096.99
4.3.50.0030.0096.99
4.3.40.0030.0146.94
4.3.30.0060.0096.33
4.3.20.0050.0086.32
4.3.10.0050.0076.30
4.3.00.0100.0168.05

preferences:
46.01 ms | 401 KiB | 5 Q