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.'>'; $tag = ""; } $i=0; $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.60.0090.00618.43
8.3.50.0130.00721.14
8.3.40.0120.00618.72
8.3.30.0140.00019.23
8.3.20.0070.00020.34
8.3.10.0040.00423.64
8.3.00.0050.00319.51
8.2.180.0170.00316.75
8.2.170.0070.01418.91
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00320.85
8.2.110.0070.00320.47
8.2.100.0060.00617.75
8.2.90.0050.00319.20
8.2.80.0000.00817.97
8.2.70.0070.00517.38
8.2.60.0030.00717.93
8.2.50.0040.00418.07
8.2.40.0050.00318.16
8.2.30.0050.00318.07
8.2.20.0050.00317.89
8.2.10.0050.00318.13
8.2.00.0000.00717.76
8.1.280.0130.00725.92
8.1.270.0080.00023.92
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0030.00623.88
8.1.230.0000.01120.93
8.1.220.0000.00917.77
8.1.210.0000.00918.77
8.1.200.0030.00617.10
8.1.190.0040.00417.36
8.1.180.0030.00618.10
8.1.170.0030.00618.59
8.1.160.0000.00722.09
8.1.150.0000.00718.82
8.1.140.0000.00817.41
8.1.130.0000.00717.84
8.1.120.0030.00517.51
8.1.110.0040.00417.46
8.1.100.0040.00417.38
8.1.90.0040.00417.41
8.1.80.0000.00717.54
8.1.70.0030.00317.43
8.1.60.0000.00817.60
8.1.50.0080.00017.57
8.1.40.0060.00317.57
8.1.30.0000.00817.66
8.1.20.0040.00417.69
8.1.10.0070.00017.53
8.1.00.0040.00417.36
8.0.300.0050.00218.77
8.0.290.0040.00416.75
8.0.280.0030.00318.42
8.0.270.0000.00817.20
8.0.260.0030.00317.29
8.0.250.0030.00316.94
8.0.240.0000.00716.98
8.0.230.0040.00417.10
8.0.220.0030.00316.96
8.0.210.0070.00017.00
8.0.200.0000.00716.91
8.0.190.0000.00816.97
8.0.180.0070.00017.01
8.0.170.0000.00917.08
8.0.160.0070.00016.94
8.0.150.0040.00416.92
8.0.140.0000.00816.88
8.0.130.0000.00613.41
8.0.120.0030.00616.82
8.0.110.0040.00416.91
8.0.100.0040.00416.96
8.0.90.0040.00417.02
8.0.80.0000.01616.98
8.0.70.0020.00516.89
8.0.60.0040.00416.94
8.0.50.0000.00716.80
8.0.30.0180.00817.17
8.0.20.0090.01017.40
8.0.10.0000.00817.00
8.0.00.0120.00816.81
7.4.330.0020.00215.02
7.4.320.0060.00016.62
7.4.300.0060.00016.57
7.4.290.0080.00016.55
7.4.280.0000.00816.64
7.4.270.0030.00316.58
7.4.260.0030.00316.52
7.4.250.0050.00316.55
7.4.240.0030.00316.62
7.4.230.0000.00816.42
7.4.220.0030.01416.67
7.4.210.0120.00616.57
7.4.200.0000.00816.61
7.4.160.0100.00716.83
7.4.150.0170.00717.40
7.4.140.0130.00917.86
7.4.130.0070.00916.51
7.4.120.0090.01016.68
7.4.110.0070.01716.69
7.4.100.0090.00916.45
7.4.90.0040.01316.51
7.4.80.0070.01019.39
7.4.70.0150.00416.54
7.4.60.0130.00316.54
7.4.50.0080.00016.43
7.4.40.0060.00916.76
7.4.30.0040.01216.73
7.4.00.0100.00714.92
7.3.330.0060.00013.29
7.3.320.0000.00513.43
7.3.310.0000.00716.27
7.3.300.0000.00716.43
7.3.290.0060.01016.44
7.3.280.0100.00816.44
7.3.270.0100.01017.40
7.3.260.0030.01416.61
7.3.250.0070.01016.59
7.3.240.0100.01016.68
7.3.230.0060.01116.62
7.3.210.0100.00716.51
7.3.200.0060.01019.39
7.3.190.0130.00716.36
7.3.180.0120.00316.48
7.3.170.0030.01516.64
7.3.160.0150.00016.45
7.3.10.0070.01016.60
7.3.00.0110.00416.77
7.2.330.0070.01016.70
7.2.320.0120.00616.86
7.2.310.0090.00916.69
7.2.300.0070.01016.81
7.2.290.0060.01316.82
7.2.130.0090.00716.74
7.2.120.0020.01016.84
7.2.110.0040.01316.87
7.2.100.0050.00816.78
7.2.90.0130.00516.98
7.2.80.0090.00716.87
7.2.70.0080.00516.82
7.2.60.0080.00716.85
7.2.50.0090.00816.97
7.2.40.0070.00716.81
7.2.30.0080.00616.93
7.2.20.0080.00516.79
7.2.10.0040.00716.73
7.2.00.0060.00717.72
7.1.250.0060.00815.67
7.1.240.0070.00515.70
7.1.230.0060.00615.82
7.1.220.0080.00815.51
7.1.210.0090.00515.87
7.1.200.0070.00615.82
7.1.190.0080.00815.63
7.1.180.0020.01215.84
7.1.170.0080.00615.83
7.1.160.0100.00515.90
7.1.150.0020.01015.88
7.1.140.0100.00315.71
7.1.130.0060.00715.71
7.1.120.0110.00315.86
7.1.110.0080.00815.73
7.1.100.0070.00616.50
7.1.90.0120.00315.78
7.1.80.0050.01115.81
7.1.70.0060.00516.19
7.1.60.0080.00716.97
7.1.50.0040.01216.11
7.1.40.0090.00815.76
7.1.30.0080.00415.81
7.1.20.0080.00715.77
7.1.10.0060.00715.73
7.1.00.0050.02818.03
7.0.330.0030.00615.29
7.0.320.0030.00815.40
7.0.310.0050.00915.16
7.0.300.0020.01115.10
7.0.290.0080.00215.08
7.0.280.0060.01015.27
7.0.270.0080.00315.33
7.0.260.0050.00815.13
7.0.250.0080.00815.51
7.0.240.0060.01115.36
7.0.230.0100.00815.30
7.0.220.0090.01015.20
7.0.210.0020.01015.19
7.0.200.0070.00515.79
7.0.190.0100.00815.14
7.0.180.0120.00615.40
7.0.170.0040.00815.38
7.0.160.0070.01215.29
7.0.150.0070.00715.21
7.0.140.0030.03217.60
7.0.130.0030.00915.45
7.0.120.0090.00715.40
7.0.110.0080.00815.18
7.0.100.0110.00615.27
7.0.90.0060.00515.26
7.0.80.0060.00815.35
7.0.70.0080.00715.05
7.0.60.0100.03316.79
7.0.50.0080.03116.31
7.0.40.0120.01615.63
7.0.30.0110.03215.73
7.0.20.0110.03115.58
7.0.10.0080.01815.61
7.0.00.0050.01915.52
5.6.380.0080.00614.47
5.6.370.0080.00814.43
5.6.360.0070.00814.29
5.6.350.0070.00714.52
5.6.340.0080.00614.36
5.6.330.0090.00614.34
5.6.320.0060.00814.41
5.6.310.0060.00814.30
5.6.300.0050.00914.20
5.6.290.0030.00813.99
5.6.280.0020.03116.72
5.6.270.0060.00914.12
5.6.260.0080.00314.28
5.6.250.0070.00714.29
5.6.240.0060.00814.31
5.6.230.0050.01014.13
5.6.220.0070.00414.32
5.6.210.0070.01816.42
5.6.200.0060.01815.72
5.6.190.0090.02216.45
5.6.180.0110.01716.21
5.6.170.0110.02316.47
5.6.160.0070.01816.40
5.6.150.0010.03815.63
5.6.140.0080.03015.63
5.6.130.0080.03315.76
5.6.120.0080.03216.60
5.6.110.0050.03516.54
5.6.100.0060.02416.60
5.6.90.0090.02616.55
5.6.80.0080.02816.37
5.6.70.1490.01716.32
5.6.60.0080.00514.23
5.6.50.0060.00814.29
5.6.40.0080.00614.13
5.6.30.0080.00514.26
5.6.20.0070.00714.30
5.6.10.0030.01214.17
5.6.00.0090.00314.36
5.5.380.0060.00411.30
5.5.370.0000.00811.15
5.5.360.0060.00511.00
5.5.350.0180.02314.52
5.5.340.0030.03413.50
5.5.330.0050.03114.22
5.5.320.0120.02614.28
5.5.310.0090.03414.29
5.5.300.0050.02013.46
5.5.290.0010.02013.52
5.5.280.0060.01714.46
5.5.270.0060.02114.51
5.5.260.0050.03414.26
5.5.250.0060.02614.41
5.5.240.1390.01814.17
5.5.230.0100.00211.04
5.5.220.0090.00111.08
5.5.210.0050.00810.88
5.5.200.0040.00711.01
5.5.190.0050.00411.07
5.5.180.0020.00711.20
5.5.170.0050.00510.97
5.5.160.0050.00511.32
5.5.150.0030.00711.26
5.5.140.0080.00310.92
5.5.130.0030.00511.36
5.5.120.0000.00911.15
5.5.110.0050.00411.40
5.5.100.0080.00411.34
5.5.90.0040.00811.22
5.5.80.0040.00911.30
5.5.70.0020.00810.89
5.5.60.0030.01011.14
5.5.50.0010.01010.92
5.5.40.0050.00811.14
5.5.30.0050.00511.07
5.5.20.0110.00011.31
5.5.10.0040.00411.17
5.5.00.0050.00511.09
5.4.450.0310.02113.90
5.4.440.0310.02714.06
5.4.430.0280.02513.91
5.4.420.0290.02113.93
5.4.410.0280.02713.84
5.4.400.0280.02313.88
5.4.390.0320.02113.88
5.4.380.0270.01813.81
5.4.370.0360.03413.85
5.4.360.0100.02013.77
5.4.350.0280.02313.84
5.4.340.0070.01311.51
5.4.330.0080.00311.25
5.4.320.0030.01811.63
5.4.310.0040.01711.72
5.4.300.0050.01611.50
5.4.290.0060.01611.45
5.4.280.0060.01511.37
5.4.270.0020.02011.39
5.4.260.0050.01711.36
5.4.250.0040.01811.45
5.4.240.0050.01611.50
5.4.230.0030.01911.49
5.4.220.0070.01811.45
5.4.210.0060.02011.31
5.4.200.0040.02011.37
5.4.190.0030.01811.38
5.4.180.0060.01411.42
5.4.170.0040.01611.43
5.4.160.0040.02011.41
5.4.150.0060.01511.50
5.4.140.0060.01411.22
5.4.130.0070.01311.27
5.4.120.0030.01511.36
5.4.110.0060.01611.21
5.4.100.0050.02211.37
5.4.90.0050.01811.36
5.4.80.0060.02011.30
5.4.70.0060.02011.11
5.4.60.0070.01411.32
5.4.50.0030.01711.38
5.4.40.0040.01711.38
5.4.30.0070.01311.23
5.4.20.0040.01611.17
5.4.10.0050.01411.39
5.4.00.0050.01711.11
5.3.290.0070.01711.47
5.3.280.0080.01411.33
5.3.270.0040.01711.44
5.3.260.0050.01611.47
5.3.250.0060.01511.39
5.3.240.0050.01511.42
5.3.230.0040.01611.33
5.3.220.0050.01811.38
5.3.210.0060.01411.40
5.3.200.0080.01311.31
5.3.190.0070.01811.37
5.3.180.0040.01811.47
5.3.170.0040.01711.47
5.3.160.0040.01811.38
5.3.150.0040.01611.39
5.3.140.0050.01411.43
5.3.130.0060.01511.44
5.3.120.0040.01711.34
5.3.110.0020.02011.41
5.3.100.0060.01511.20
5.3.90.0070.01411.28
5.3.80.0050.01411.14
5.3.70.0080.01111.21
5.3.60.0070.01511.25
5.3.50.0050.01611.18
5.3.40.0040.01411.20
5.3.30.0030.01711.20
5.3.20.0060.01311.15
5.3.10.0020.01711.05
5.3.00.0060.01510.96
5.2.170.0010.0169.94
5.2.160.0060.0129.94
5.2.150.0020.0159.93
5.2.140.0030.0159.96
5.2.130.0070.0139.81
5.2.120.0050.0139.80
5.2.110.0060.0109.83
5.2.100.0050.0129.81
5.2.90.0030.0139.90
5.2.80.0010.0159.87
5.2.70.0080.0109.89
5.2.60.0030.0149.86
5.2.50.0060.0129.83
5.2.40.0050.0129.90
5.2.30.0060.0119.88
5.2.20.0060.0129.78
5.2.10.0030.0149.74
5.2.00.0050.0119.62
5.1.60.0060.0099.20
5.1.50.0050.0109.14
5.1.40.0050.0119.24
5.1.30.0040.0139.25
5.1.20.0050.0119.35
5.1.10.0050.0109.16
5.1.00.0060.0119.20
5.0.50.0040.0108.54
5.0.40.0040.0078.49
5.0.30.0020.0158.43
5.0.20.0030.0118.42
5.0.10.0020.0108.41
5.0.00.0030.0128.41
4.4.90.0020.0077.90
4.4.80.0020.0077.89
4.4.70.0020.0087.89
4.4.60.0020.0117.89
4.4.50.0030.0127.89
4.4.40.0030.0107.88
4.4.30.0040.0077.89
4.4.20.0020.0097.92
4.4.10.0030.0097.92
4.4.00.0020.0147.89
4.3.110.0030.0117.86
4.3.100.0040.0077.86
4.3.90.0000.0087.85
4.3.80.0000.0117.83
4.3.70.0030.0067.85
4.3.60.0030.0087.84
4.3.50.0020.0117.85
4.3.40.0030.0127.82
4.3.30.0020.0107.41
4.3.20.0010.0087.40
4.3.10.0010.0087.39
4.3.00.0030.0118.56

preferences:
52.87 ms | 401 KiB | 5 Q