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 = strlen(check_plain(substr($str, 0, $cutlength))) - $maxlength) { print "\nDELTA: " . $delta . "\n"; $cutlength += $delta; } print "\nEND DELTA: " . $delta . "\n"; 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.0070.01416.50
8.3.50.0220.01221.21
8.3.40.0160.00718.70
8.3.30.0240.01019.04
8.3.20.0130.00920.33
8.3.10.0190.00623.48
8.3.00.0070.01119.01
8.2.180.0180.00416.32
8.2.170.0150.00622.96
8.2.160.0190.01020.45
8.2.150.0110.00024.18
8.2.140.0030.00724.66
8.2.130.0040.00826.16
8.2.120.0080.00622.25
8.2.110.0120.00022.13
8.2.100.0160.00017.84
8.2.90.0070.00319.17
8.2.80.0060.00917.97
8.2.70.0060.00317.75
8.2.60.0090.00318.05
8.2.50.0000.01218.07
8.2.40.0000.00919.76
8.2.30.0000.01019.86
8.2.20.0060.00817.65
8.2.10.0100.00518.09
8.2.00.0030.01017.89
8.1.280.0190.00625.92
8.1.270.0040.00822.24
8.1.260.0040.00726.35
8.1.250.0110.00028.09
8.1.240.0090.00323.87
8.1.230.0110.00319.16
8.1.220.0060.00617.74
8.1.210.0060.00318.77
8.1.200.0060.00617.35
8.1.190.0070.01017.53
8.1.180.0070.00318.10
8.1.170.0030.00918.67
8.1.160.0030.00722.09
8.1.150.0130.00018.77
8.1.140.0070.00317.46
8.1.130.0030.00617.80
8.1.120.0090.00017.54
8.1.110.0070.00717.41
8.1.100.0060.00617.42
8.1.90.0080.00017.55
8.1.80.0060.00317.48
8.1.70.0000.00917.45
8.1.60.0070.00317.68
8.1.50.0070.00417.53
8.1.40.0030.00717.57
8.1.30.0060.00617.59
8.1.20.0000.01017.67
8.1.10.0030.00617.56
8.1.00.0030.00617.50
8.0.300.0000.00918.96
8.0.290.0030.00716.93
8.0.280.0030.00618.40
8.0.270.0070.00417.20
8.0.260.0070.00417.25
8.0.250.0040.00416.99
8.0.240.0070.00316.81
8.0.230.0030.00616.71
8.0.220.0070.00316.74
8.0.210.0060.00316.79
8.0.200.0060.00316.79
8.0.190.0000.01016.79
8.0.180.0030.00616.90
8.0.170.0030.00716.89
8.0.160.0000.01016.80
8.0.150.0040.00416.78
8.0.140.0080.00416.69
8.0.130.0030.01313.29
8.0.120.0000.01016.69
8.0.110.0060.00316.66
8.0.100.0060.00316.81
8.0.90.0060.00316.65
8.0.80.0090.01816.75
8.0.70.0080.00316.66
8.0.60.0000.00916.57
8.0.50.0000.00916.56
8.0.30.0440.03116.92
8.0.20.0570.02317.40
8.0.10.0030.00616.88
8.0.00.0410.02516.84
7.4.330.0060.00315.03
7.4.320.0030.00716.32
7.4.300.0030.00916.28
7.4.290.0030.00716.40
7.4.280.0030.00616.46
7.4.270.0040.00816.48
7.4.260.0070.00416.43
7.4.250.0030.00716.45
7.4.240.0050.00616.39
7.4.230.0000.00916.42
7.4.220.0090.02116.59
7.4.210.0110.01016.39
7.4.200.0000.01016.38
7.4.190.0060.00316.35
7.4.160.0460.03016.64
7.4.150.0220.00617.40
7.4.140.0330.04117.86
7.4.130.0450.03616.50
7.4.120.0160.01516.43
7.4.110.0260.01016.54
7.4.100.0590.07016.47
7.4.90.0710.02516.52
7.4.80.0110.01819.39
7.4.70.0110.02116.50
7.4.60.0500.05716.52
7.4.50.0090.00316.39
7.4.40.0100.01022.77
7.4.30.0510.03216.16
7.4.00.0060.01415.02
7.3.330.0060.00313.39
7.3.320.0050.00313.36
7.3.310.0030.00716.23
7.3.300.0060.00616.26
7.3.290.0030.02016.32
7.3.280.0160.01216.27
7.3.270.0590.03717.40
7.3.260.0210.01216.29
7.3.250.0270.02516.44
7.3.240.0270.00616.38
7.3.230.0240.00716.39
7.3.210.0530.03516.39
7.3.200.0160.02419.39
7.3.190.0060.03416.26
7.3.180.0130.01316.38
7.3.170.0350.02016.49
7.3.160.0580.04516.27
7.3.120.0030.01515.07
7.2.330.0420.03816.54
7.2.320.0110.01816.35
7.2.310.0100.01716.71
7.2.300.0170.01016.62
7.2.290.0160.02216.66
7.2.00.0130.00319.62
7.1.100.0060.01217.66
7.1.70.0030.00617.19
7.1.60.0170.02019.46
7.1.50.0270.02035.13
7.0.200.0090.00616.73

preferences:
40.07 ms | 401 KiB | 5 Q