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 = "<p>hello world how is everyone doing today</p>"; 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.40.0110.00418.80
8.3.30.0000.01419.23
8.3.20.0040.00420.35
8.3.10.0090.00623.72
8.3.00.0080.00019.38
8.2.170.0110.00322.96
8.2.160.0070.00720.27
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0040.00421.04
8.2.110.0030.00720.39
8.2.100.0090.00317.88
8.2.90.0000.00919.17
8.2.80.0090.00017.97
8.2.70.0030.00717.63
8.2.60.0100.00018.03
8.2.50.0040.00418.07
8.2.40.0070.00018.22
8.2.30.0050.00218.00
8.2.20.0040.00417.86
8.2.10.0050.00318.05
8.2.00.0080.00017.72
8.1.270.0060.00322.20
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0070.00319.26
8.1.230.0090.00319.05
8.1.220.0060.00317.74
8.1.210.0000.00918.77
8.1.200.0060.00617.23
8.1.190.0080.00017.00
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0040.00422.02
8.1.150.0050.00218.81
8.1.140.0040.00417.49
8.1.130.0040.00419.61
8.1.120.0050.00217.38
8.1.110.0030.00517.44
8.1.100.0000.00717.51
8.1.90.0000.00817.46
8.1.80.0020.00517.33
8.1.70.0030.00317.41
8.1.60.0030.00617.52
8.1.50.0080.00017.48
8.1.40.0000.00817.52
8.1.30.0050.00317.70
8.1.20.0000.00717.63
8.1.10.0050.00317.48
8.1.00.0000.00817.41
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0000.00717.21
8.0.260.0030.00317.21
8.0.250.0030.00317.00
8.0.240.0040.00416.95
8.0.230.0000.00717.10
8.0.220.0030.00316.98
8.0.210.0000.00716.95
8.0.200.0000.00616.86
8.0.190.0030.00516.89
8.0.180.0040.00417.00
8.0.170.0030.00617.00
8.0.160.0040.00416.86
8.0.150.0050.00216.82
8.0.140.0000.00716.93
8.0.130.0030.00313.36
8.0.120.0000.00816.88
8.0.110.0040.00416.86
8.0.100.0070.00016.75
8.0.90.0030.00316.97
8.0.80.0100.00616.94
8.0.70.0030.00516.97
8.0.60.0040.00416.75
8.0.50.0000.00716.95
8.0.30.0050.01517.19
8.0.20.0080.01117.40
8.0.10.0050.00317.11
8.0.00.0110.01016.79
7.4.330.0000.00515.02
7.4.320.0040.00416.56
7.4.300.0000.00716.50
7.4.290.0080.00016.45
7.4.280.0070.00016.45
7.4.270.0030.00316.51
7.4.260.0030.00516.41
7.4.250.0040.00416.61
7.4.240.0030.00516.50
7.4.230.0000.00716.38
7.4.220.0090.01716.58
7.4.210.0050.00916.62
7.4.200.0000.00716.61
7.4.160.0130.00916.51
7.4.150.0180.00617.40
7.4.140.0110.00817.86
7.4.130.0100.00916.40
7.4.120.0050.01316.46
7.4.110.0040.01216.50
7.4.100.0060.01016.71
7.4.90.0170.00316.69
7.4.80.0070.01319.39
7.4.70.0120.00616.61
7.4.60.0060.01016.33
7.4.50.0060.00316.50
7.4.40.0060.01216.39
7.4.30.0100.00716.68
7.4.00.0090.00615.04
7.3.330.0060.00013.45
7.3.320.0030.00313.29
7.3.310.0030.00316.46
7.3.300.0000.00716.38
7.3.290.0090.00616.43
7.3.280.0080.00916.48
7.3.270.0140.00917.40
7.3.260.0100.00616.43
7.3.250.0120.00516.57
7.3.240.0120.00416.60
7.3.230.0130.00316.46
7.3.210.0110.00716.54
7.3.200.0130.00319.39
7.3.190.0150.00316.54
7.3.180.0120.00316.61
7.3.170.0040.01116.45
7.3.160.0080.00816.61
7.3.10.0030.01016.71
7.3.00.0060.00516.34
7.2.330.0090.00916.63
7.2.320.0060.01316.77
7.2.310.0090.00916.67
7.2.300.0070.01016.48
7.2.290.0070.01316.68
7.2.130.0070.00916.85
7.2.120.0090.00716.91
7.2.110.0070.00716.86
7.2.100.0090.00716.77
7.2.90.0100.00416.62
7.2.80.0110.00616.78
7.2.70.0080.00416.80
7.2.60.0050.00916.55
7.2.50.0090.00716.92
7.2.40.0110.00516.84
7.2.30.0110.00516.93
7.2.20.0120.00516.74
7.2.10.0090.00716.76
7.2.00.0070.00817.82
7.1.250.0040.00815.89
7.1.240.0080.00715.85
7.1.230.0140.00315.80
7.1.220.0080.00415.77
7.1.210.0110.00415.83
7.1.200.0060.00615.69
7.1.190.0070.00415.82
7.1.180.0070.00715.64
7.1.170.0080.00816.02
7.1.160.0070.00715.53
7.1.150.0120.00615.84
7.1.140.0110.00415.93
7.1.130.0080.00815.97
7.1.120.0080.00815.91
7.1.110.0060.00615.89
7.1.100.0080.00516.89
7.1.90.0070.01015.84
7.1.80.0130.00315.95
7.1.70.0020.00716.67
7.1.60.0060.00917.61
7.1.50.0120.00916.40
7.1.40.0130.00615.52
7.1.30.0030.01015.75
7.1.20.0180.00015.84
7.1.10.0100.00715.69
7.1.00.0020.04218.98
7.0.330.0040.00815.12
7.0.320.0090.00315.29
7.0.310.0070.00715.52
7.0.300.0090.00915.52
7.0.290.0120.00615.57
7.0.280.0070.01115.32
7.0.270.0030.01315.44
7.0.260.0070.00715.35
7.0.250.0060.00615.44
7.0.240.0060.00615.29
7.0.230.0060.00915.18
7.0.220.0040.00815.66
7.0.210.0100.00715.58
7.0.200.0050.00915.95
7.0.190.0080.00815.29
7.0.180.0090.00615.07
7.0.170.0030.00915.45
7.0.160.0120.00615.30
7.0.150.0130.00315.22
7.0.140.0040.04418.61
7.0.130.0120.00615.51
7.0.120.0070.01015.61
7.0.110.0100.00715.25
7.0.100.0100.01015.00
7.0.90.0040.00715.08
7.0.80.0080.00615.07
7.0.70.0090.00615.24
7.0.60.0150.04017.52
7.0.50.0100.03216.54
7.0.40.0120.03716.74
7.0.30.0260.02716.67
7.0.20.0210.02316.85
7.0.10.1600.02216.76
7.0.00.0050.03716.79
5.6.380.0060.00614.22
5.6.370.0110.00414.11
5.6.360.0090.00914.55
5.6.350.0130.00313.87
5.6.340.0040.01214.53
5.6.330.0070.00714.22
5.6.320.0110.00314.38
5.6.310.0040.00914.44
5.6.300.0110.00614.35
5.6.290.0150.00314.62
5.6.280.0100.03917.54
5.6.270.0130.00314.04
5.6.260.0070.01414.19
5.6.250.0190.00314.27
5.6.240.0100.00514.25
5.6.230.0140.00614.25
5.6.220.0110.00714.32
5.6.210.0130.03917.47
5.6.200.0040.02516.19
5.6.190.0090.04117.22
5.6.180.0150.03917.53
5.6.170.0200.03717.42
5.6.160.0100.04517.30
5.6.150.0130.04216.25
5.6.140.0090.04216.05
5.6.130.0060.04616.17
5.6.120.0100.04017.62
5.6.110.0100.04217.56
5.6.100.0080.04317.76
5.6.90.0120.03717.73
5.6.80.0110.03417.15
5.6.70.2200.02517.31
5.6.60.0040.01114.24
5.6.50.0070.01514.32
5.6.40.0100.00313.99
5.6.30.0060.00814.42
5.6.20.0000.01614.15
5.6.10.0070.01014.13
5.6.00.0050.01014.15
5.5.380.0030.01011.38
5.5.370.0040.00911.24
5.5.360.0030.01011.42
5.5.350.0050.04815.79
5.5.340.0100.02814.51
5.5.330.0050.04615.70
5.5.320.0250.02815.66
5.5.310.0130.02215.57
5.5.300.0050.02014.53
5.5.290.0030.03714.68
5.5.280.0030.02816.00
5.5.270.0110.03815.98
5.5.260.0060.04815.78
5.5.250.0110.04315.93
5.5.240.0200.03515.68
5.5.230.0050.00210.90
5.5.220.0060.00311.27
5.5.210.0060.00311.11
5.5.200.0070.00410.55
5.5.190.0090.00310.95
5.5.180.0030.00911.18
5.5.170.0060.00610.82
5.5.160.0040.00811.19
5.5.150.0040.00410.81
5.5.140.0090.00311.08
5.5.130.0060.00611.00
5.5.120.0040.00811.00
5.5.110.0030.01011.17
5.5.100.0110.00511.02
5.5.90.0050.00510.54
5.5.80.0050.00511.10
5.5.70.0140.00010.91
5.5.60.0060.00910.62
5.5.50.0090.00610.98
5.5.40.0030.00711.11
5.5.30.0000.01210.93
5.5.20.0040.00411.16
5.5.10.0040.00811.31
5.5.00.0040.00411.25
5.4.450.0480.03215.24
5.4.440.0500.03315.23
5.4.430.0500.03515.29
5.4.420.0470.04115.32
5.4.410.0230.03315.16
5.4.400.0490.03215.17
5.4.390.0500.03315.29
5.4.380.0420.03115.15
5.4.370.0140.03415.35
5.4.360.0450.03815.00
5.4.350.0530.02615.15
5.4.340.0080.02211.39
5.4.330.0080.00811.24
5.4.320.0050.02511.85
5.4.310.0060.02911.82
5.4.300.0050.02311.80
5.4.290.0060.02411.82
5.4.280.0080.02311.72
5.4.270.0070.02311.60
5.4.260.0090.02011.83
5.4.250.0100.02111.88
5.4.240.0020.02811.70
5.4.230.0090.02011.80
5.4.220.0070.02111.90
5.4.210.0100.01811.67
5.4.200.0100.02011.78
5.4.190.0090.01911.64
5.4.180.0070.02111.60
5.4.170.0060.02111.87
5.4.160.0110.01811.61
5.4.150.0070.02011.90
5.4.140.0070.02111.62
5.4.130.0090.01911.61
5.4.120.0050.02311.76
5.4.110.0090.02211.61
5.4.100.0100.02411.74
5.4.90.0090.01911.57
5.4.80.0070.02411.63
5.4.70.0090.02511.56
5.4.60.0090.01811.63
5.4.50.0060.02411.46
5.4.40.0080.02111.51
5.4.30.0090.02211.49
5.4.20.0060.02511.58
5.4.10.0120.02311.47
5.4.00.0080.02311.23
5.3.290.0110.01911.77
5.3.280.0070.02511.63
5.3.270.0090.02211.72
5.3.260.0070.02111.67
5.3.250.0060.02211.72
5.3.240.0060.02111.49
5.3.230.0050.02211.61
5.3.220.0070.02211.57
5.3.210.0030.02311.63
5.3.200.0090.02111.65
5.3.190.0040.02511.55
5.3.180.0080.01811.60
5.3.170.0030.02211.74
5.3.160.0090.01911.68
5.3.150.0030.02511.72
5.3.140.0040.02511.67
5.3.130.0050.02011.70
5.3.120.0070.02011.68
5.3.110.0040.02411.66
5.3.100.0040.02311.41
5.3.90.0050.02111.28
5.3.80.0020.02311.30
5.3.70.0020.02411.42
5.3.60.0050.01911.28
5.3.50.0090.01911.38
5.3.40.0040.02311.29
5.3.30.0060.02211.18
5.3.20.0090.01911.18
5.3.10.0020.02611.10
5.3.00.0080.01811.04
5.2.170.0040.0169.58
5.2.160.0020.0199.59
5.2.150.0040.0189.59
5.2.140.0040.0179.58
5.2.130.0070.0149.57
5.2.120.0070.0149.56
5.2.110.0040.0179.57
5.2.100.0020.0189.57
5.2.90.0030.0199.57
5.2.80.0050.0189.56
5.2.70.0080.0189.56
5.2.60.0090.0179.54
5.2.50.0050.0189.53
5.2.40.0060.0159.52
5.2.30.0050.0189.50
5.2.20.0060.0159.50
5.2.10.0020.0189.45
5.2.00.0020.0199.38
5.1.60.0050.0139.02
5.1.50.0080.0139.02
5.1.40.0050.0129.01
5.1.30.0020.0179.19
5.1.20.0010.0189.20
5.1.10.0070.0169.06
5.1.00.0060.0169.06
5.0.50.0050.0118.30
5.0.40.0010.0138.23
5.0.30.0020.0188.14
5.0.20.0020.0148.12
5.0.10.0040.0128.11
5.0.00.0030.0188.11
4.4.90.0010.0107.36
4.4.80.0050.0107.35
4.4.70.0010.0107.35
4.4.60.0010.0117.35
4.4.50.0030.0107.36
4.4.40.0030.0147.33
4.4.30.0040.0137.35
4.4.20.0030.0107.40
4.4.10.0010.0117.40
4.4.00.0030.0147.35
4.3.110.0040.0097.31
4.3.100.0010.0097.30
4.3.90.0020.0107.29
4.3.80.0020.0157.26
4.3.70.0030.0087.29
4.3.60.0040.0087.29
4.3.50.0040.0097.29
4.3.40.0010.0167.24
4.3.30.0030.0096.63
4.3.20.0000.0126.62
4.3.10.0010.0096.60
4.3.00.0100.0108.53

preferences:
46.18 ms | 404 KiB | 6 Q