3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check_plain($text) { return htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); } $str = '<strong>foobar</strong>'; print strlen($str) . "\n"; $maxlength = 4; $cutlength = $maxlength; while (0 < $delta = $maxlength - strlen(check_plain(substr($str, 0, $cutlength)))) { $cutlength += $delta; } print substr($str, 0, $cutlength);

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.0100.01016.50
8.3.50.0230.00521.31
8.3.40.0150.00319.02
8.3.30.0160.00619.09
8.3.20.0070.00720.05
8.3.10.0090.00023.56
8.3.00.0040.00719.38
8.2.180.0080.00818.39
8.2.170.0040.01122.96
8.2.160.0100.00320.43
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0140.00026.16
8.2.120.0000.00722.24
8.2.110.0060.00322.29
8.2.100.0080.00317.91
8.2.90.0000.00819.01
8.2.80.0000.00817.97
8.2.70.0030.00517.48
8.2.60.0030.00618.04
8.2.50.0040.00818.07
8.2.40.0080.00019.88
8.2.30.0040.00419.84
8.2.20.0030.00517.73
8.2.10.0070.00018.02
8.2.00.0070.00317.55
8.1.280.0120.00925.92
8.1.270.0090.00023.84
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0040.00423.93
8.1.230.0070.00419.16
8.1.220.0080.00017.79
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0040.00417.40
8.1.180.0030.00618.10
8.1.170.0000.00818.71
8.1.160.0040.00422.02
8.1.150.0040.00418.66
8.1.140.0000.00717.32
8.1.130.0040.00417.74
8.1.120.0030.00317.34
8.1.110.0000.00917.34
8.1.100.0040.00417.42
8.1.90.0040.00417.36
8.1.80.0060.00317.50
8.1.70.0030.00317.40
8.1.60.0090.00017.41
8.1.50.0000.00717.49
8.1.40.0000.00817.55
8.1.30.0050.00317.51
8.1.20.0040.00417.67
8.1.10.0040.00417.39
8.1.00.0040.00417.34
8.0.300.0080.00019.09
8.0.290.0040.00417.18
8.0.280.0000.00718.45
8.0.270.0040.00417.17
8.0.260.0000.00617.21
8.0.250.0000.00816.99
8.0.240.0030.00616.87
8.0.230.0000.00716.96
8.0.220.0030.00516.86
8.0.210.0040.00416.89
8.0.200.0000.00716.95
8.0.190.0000.00816.96
8.0.180.0040.00416.82
8.0.170.0040.00416.85
8.0.160.0050.00316.79
8.0.150.0000.00716.85
8.0.140.0040.00416.92
8.0.130.0040.00413.36
8.0.120.0080.00016.82
8.0.110.0040.00416.94
8.0.100.0000.00716.92
8.0.90.0000.00716.86
8.0.80.0070.01016.91
8.0.70.0070.00016.77
8.0.60.0050.00316.74
8.0.50.0000.00716.72
8.0.30.0140.00516.94
8.0.20.0130.00917.46
8.0.10.0000.00816.81
8.0.00.0060.01216.65
7.4.330.0020.00215.08
7.4.320.0030.00316.58
7.4.300.0000.00716.64
7.4.290.0030.00316.52
7.4.280.0070.00016.49
7.4.270.0030.00316.64
7.4.260.0030.00316.39
7.4.250.0040.00416.56
7.4.240.0040.00316.46
7.4.230.0030.00316.68
7.4.220.0080.00916.59
7.4.210.0040.01016.47
7.4.200.0030.00316.68
7.4.190.0030.00416.77
7.4.160.0130.00316.60
7.4.150.0030.01617.40
7.4.140.0090.00817.86
7.4.130.0150.01016.51
7.4.120.0100.00916.46
7.4.110.0140.01116.43
7.4.100.0090.00916.38
7.4.90.0090.00916.63
7.4.80.0070.01719.39
7.4.70.0130.00516.45
7.4.60.0060.01116.49
7.4.50.0020.00516.41
7.4.40.0030.01022.77
7.4.30.0130.00316.37
7.4.00.0020.01214.96
7.3.330.0020.00313.34
7.3.320.0000.00513.37
7.3.310.0030.00316.16
7.3.300.0020.00516.33
7.3.290.0130.00316.33
7.3.280.0090.00716.35
7.3.270.0060.01617.40
7.3.260.0110.00616.42
7.3.250.0130.00716.55
7.3.240.0070.01016.42
7.3.230.0060.01016.39
7.3.210.0140.00316.52
7.3.200.0120.01119.39
7.3.190.0100.01316.39
7.3.180.0140.00716.66
7.3.170.0080.00816.62
7.3.160.0130.00316.42
7.3.120.0070.00714.64
7.3.110.0030.01314.80
7.3.100.0040.01114.85
7.3.90.0000.01114.93
7.3.80.0070.00414.58
7.3.70.0000.00814.86
7.3.60.0030.00614.62
7.3.50.0040.00814.67
7.3.40.0100.00614.89
7.3.30.0040.00814.94
7.3.20.0060.00316.69
7.3.10.0030.00716.76
7.3.00.0040.01216.77
7.2.330.0100.00716.67
7.2.320.0130.00416.41
7.2.310.0090.00816.53
7.2.300.0060.00916.69
7.2.290.0130.01016.36
7.2.250.0030.01315.20
7.2.240.0060.01015.23
7.2.230.0040.01515.02
7.2.220.0070.01015.23
7.2.210.0030.00915.23
7.2.200.0070.00714.88
7.2.190.0000.00914.97
7.2.180.0060.00615.19
7.2.170.0100.00715.05
7.2.60.0030.00916.86
7.2.00.0000.01319.38
7.1.330.0110.00415.85
7.1.320.0060.00915.89
7.1.310.0050.00515.91
7.1.300.0030.00715.86
7.1.290.0030.00915.73
7.1.280.0030.01315.88
7.1.270.0110.00415.56
7.1.260.0070.00415.76
7.1.200.0030.01215.82
7.1.100.0070.00317.90
7.1.70.0000.00717.22
7.1.60.0070.01719.46
7.1.50.0170.00334.50
7.1.00.0070.07322.46
7.0.200.0050.00216.53
7.0.140.0070.07022.11
7.0.60.0030.08319.89
7.0.50.0030.04317.84
7.0.40.0070.07320.40
7.0.30.0100.04720.21
7.0.20.0370.05320.06
7.0.10.0100.06020.07
7.0.00.0030.07320.20
5.6.210.0130.06720.57
5.6.200.0100.08318.18
5.6.190.0100.05720.52
5.6.180.0200.04020.64
5.6.170.0330.07320.48
5.6.160.0130.08020.43
5.6.150.0130.07718.12
5.6.140.0000.04718.17
5.6.130.0070.08718.28
5.6.120.0130.07721.09
5.6.110.0070.06721.04
5.6.100.0030.04021.13
5.6.90.0100.07321.13
5.6.80.0070.07020.29
5.6.70.0130.07720.43
5.5.350.0300.06020.34
5.5.340.0000.05017.98
5.5.330.0070.04320.44
5.5.320.0100.08020.36
5.5.310.0470.05720.41
5.5.300.0100.07317.98
5.5.290.0170.07017.95
5.5.280.0070.05020.77
5.5.270.0330.04720.72
5.5.260.0130.06320.76
5.5.250.0000.07320.55
5.5.240.0230.08020.15
5.4.450.0100.04319.57
5.4.440.0170.03719.41
5.4.430.0130.04019.56
5.4.420.0230.03719.19
5.4.410.0130.04019.35
5.4.400.0130.04019.06
5.4.390.0100.04318.97
5.4.380.0230.03319.14
5.4.370.0130.04019.23
5.4.360.0070.04719.22
5.4.350.0130.05719.20
5.4.340.0200.03019.33
5.4.320.0130.04019.23
5.4.310.0200.03019.31
5.4.300.0130.03719.05
5.4.290.0170.03719.15
5.4.280.0100.04719.31
5.4.270.0100.04019.16
5.4.260.0130.03719.33
5.4.250.0200.03319.22
5.4.240.0200.03719.23
5.4.230.0130.03719.25
5.4.220.0200.04018.88
5.4.210.0100.04319.23
5.4.200.0170.03319.21
5.4.190.0200.05319.13
5.4.180.0130.04019.05
5.4.170.0200.06019.08
5.4.160.0330.02719.04
5.4.150.0170.03718.98
5.4.140.0200.03316.40
5.4.130.0200.03016.40
5.4.120.0200.03016.32
5.4.110.0100.04016.55
5.4.100.0130.04716.55
5.4.90.0130.05016.26
5.4.80.0230.03016.38
5.4.70.0170.04316.25
5.4.60.0200.03016.25
5.4.50.0130.04716.34
5.4.40.0170.03316.52
5.4.30.0070.04016.55
5.4.20.0130.03316.25
5.4.10.0200.03316.48
5.4.00.0170.03015.80
5.3.290.0170.04014.71
5.3.280.0270.03014.69
5.3.270.0230.04014.60
5.3.260.0070.04714.60
5.3.250.0070.04714.77
5.3.240.0200.03014.58
5.3.230.0130.04314.82
5.3.220.0200.03014.59
5.3.210.0130.04014.72
5.3.200.0170.05714.81
5.3.190.0170.04014.79
5.3.180.0170.03314.79
5.3.170.0130.04014.55
5.3.160.0070.04314.64
5.3.150.0170.03714.47
5.3.140.0130.03714.48
5.3.130.0130.03714.68
5.3.120.0170.03714.56
5.3.110.0200.07014.47
5.3.100.0100.04314.05
5.3.90.0130.04314.03
5.3.80.0170.03314.18
5.3.70.0170.04314.24
5.3.60.0070.04014.09
5.3.50.0130.03713.95
5.3.40.0130.03714.19
5.3.30.0230.03313.98
5.3.20.0100.04313.80
5.3.10.0100.03713.57
5.3.00.0300.04013.57
5.2.170.0170.04011.23
5.2.160.0070.03311.23
5.2.150.0200.02311.14
5.2.140.0230.02711.07
5.2.130.0100.03011.19
5.2.120.0130.03011.02
5.2.110.0170.03011.01
5.2.100.0170.03311.03
5.2.90.0200.04011.02
5.2.80.0230.04711.31
5.2.70.0170.06011.01
5.2.60.0400.03710.95
5.2.50.0170.05010.94
5.2.40.0130.06010.99
5.2.30.0170.05310.91
5.2.20.0100.03310.93
5.2.10.0100.04010.95
5.2.00.0130.05710.64
5.1.60.0130.02310.14
5.1.50.0170.02310.10
5.1.40.0070.02710.10
5.1.30.0070.03010.42
5.1.20.0130.02010.42
5.1.10.0170.02310.10
5.1.00.0170.02010.30
5.0.50.0030.02010.10
5.0.40.0100.01710.10
5.0.30.0030.03310.10
5.0.20.0030.02310.10
5.0.10.0100.01310.10
5.0.00.0070.02710.10
4.4.90.0100.02010.10
4.4.80.0130.02710.10
4.4.70.0030.01710.10
4.4.60.0070.01310.10
4.4.50.0100.02010.10
4.4.40.0100.02010.10
4.4.30.0070.01310.10
4.4.20.0030.01710.10
4.4.10.0030.01710.10
4.4.00.0070.02310.10
4.3.110.0100.01310.10
4.3.100.0030.01710.10
4.3.90.0030.01710.10
4.3.80.0070.02710.10
4.3.70.0030.01710.10
4.3.60.0030.01710.10
4.3.50.0170.01710.10
4.3.40.0000.03310.10
4.3.30.0000.01710.10
4.3.20.0030.03310.10
4.3.10.0000.02010.10
4.3.00.0030.02010.10

preferences:
44.62 ms | 400 KiB | 5 Q