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)))) { print "\n" . $delta . "\n"; $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.0080.00816.75
8.3.50.0170.00521.13
8.3.40.0320.00418.15
8.3.30.0110.00419.22
8.3.20.0040.00420.16
8.3.10.0040.00423.66
8.3.00.0080.01219.35
8.2.180.0090.01318.29
8.2.170.0070.00722.96
8.2.160.0100.00320.39
8.2.150.0040.01124.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0120.00622.08
8.2.110.0070.00320.56
8.2.100.0040.00817.73
8.2.90.0000.00719.19
8.2.80.0040.00417.97
8.2.70.0090.00017.50
8.2.60.0030.00717.92
8.2.50.0030.00618.07
8.2.40.0050.00319.89
8.2.30.0080.00019.79
8.2.20.0030.00517.59
8.2.10.0040.00419.87
8.2.00.0030.00717.58
8.1.280.0150.00425.92
8.1.270.0080.01123.98
8.1.260.0040.00426.35
8.1.250.0110.00728.09
8.1.240.0090.00021.04
8.1.230.0070.00319.03
8.1.220.0080.00017.76
8.1.210.0040.00418.77
8.1.200.0050.00517.36
8.1.190.0060.00317.53
8.1.180.0070.00218.10
8.1.170.0050.00318.50
8.1.160.0050.00222.00
8.1.150.0050.00318.69
8.1.140.0020.00517.36
8.1.130.0050.00317.82
8.1.120.0020.00517.45
8.1.110.0000.00817.46
8.1.100.0090.00017.49
8.1.90.0040.00417.46
8.1.80.0050.00317.45
8.1.70.0040.00417.41
8.1.60.0100.00017.47
8.1.50.0050.00317.50
8.1.40.0000.00817.54
8.1.30.0030.00517.56
8.1.20.0040.00417.71
8.1.10.0030.00617.44
8.1.00.0040.00417.46
8.0.300.0040.00419.21
8.0.290.0040.00417.05
8.0.280.0040.00418.44
8.0.270.0070.00017.36
8.0.260.0030.00317.19
8.0.250.0070.00016.92
8.0.240.0000.00816.99
8.0.230.0030.00716.86
8.0.220.0030.00316.86
8.0.210.0000.00716.78
8.0.200.0030.00516.89
8.0.190.0030.00616.93
8.0.180.0000.00716.96
8.0.170.0040.00416.96
8.0.160.0040.00416.87
8.0.150.0040.00416.71
8.0.140.0030.00516.83
8.0.130.0060.00013.35
8.0.120.0030.00516.74
8.0.110.0050.00216.77
8.0.100.0000.00716.70
8.0.90.0000.00716.79
8.0.80.0060.00916.87
8.0.70.0070.00016.74
8.0.60.0030.00516.77
8.0.50.0080.00016.88
8.0.30.0100.00817.27
8.0.20.0110.00817.40
8.0.10.0000.00816.83
8.0.00.0060.01316.76
7.4.330.0000.00515.00
7.4.320.0000.00716.45
7.4.300.0000.00616.58
7.4.290.0040.00416.63
7.4.280.0040.00416.49
7.4.270.0000.00816.51
7.4.260.0000.00716.62
7.4.250.0060.00316.53
7.4.240.0050.00216.53
7.4.230.0000.00716.33
7.4.220.0100.00716.54
7.4.210.0090.00716.55
7.4.200.0030.00316.33
7.4.190.0030.00316.65
7.4.160.0120.00416.51
7.4.150.0070.01017.40
7.4.140.0100.00717.86
7.4.130.0090.00816.54
7.4.120.0090.00716.40
7.4.110.0070.01716.31
7.4.100.0030.01316.46
7.4.90.0070.01016.55
7.4.80.0060.01519.39
7.4.70.0080.00816.46
7.4.60.0170.00616.36
7.4.50.0030.00316.57
7.4.40.0030.01022.77
7.4.30.0100.00716.45
7.4.00.0070.01014.81
7.3.330.0000.00613.35
7.3.320.0030.00313.20
7.3.310.0040.00416.48
7.3.300.0070.00016.27
7.3.290.0040.01116.34
7.3.280.0040.01316.33
7.3.270.0060.01117.40
7.3.260.0070.01016.64
7.3.250.0100.00716.58
7.3.240.0100.01016.60
7.3.230.0110.00516.39
7.3.210.0130.00316.38
7.3.200.0060.01519.39
7.3.190.0060.01116.60
7.3.180.0100.00716.63
7.3.170.0120.00616.39
7.3.160.0090.00916.34
7.3.120.0060.01214.56
7.3.110.0000.01414.58
7.3.100.0030.01114.53
7.3.90.0000.00914.52
7.3.80.0070.00714.82
7.3.70.0130.00314.85
7.3.60.0150.00314.86
7.3.50.0080.00615.04
7.3.40.0000.01414.72
7.3.30.0070.01114.79
7.3.20.0130.00316.82
7.3.10.0110.00416.56
7.3.00.0040.01216.88
7.2.330.0150.00516.78
7.2.320.0100.00716.44
7.2.310.0030.01416.37
7.2.300.0230.01016.34
7.2.290.0120.00616.73
7.2.240.0070.00715.04
7.2.230.0060.00614.85
7.2.220.0030.01314.43
7.2.210.0030.01414.86
7.2.200.0000.01014.99
7.2.190.0080.00314.91
7.2.180.0030.00715.15
7.2.170.0000.01415.10
7.2.160.0030.00915.00
7.2.150.0000.01216.77
7.2.140.0030.01016.78
7.2.130.0030.01016.84
7.2.120.0060.00916.91
7.2.110.0100.00617.07
7.2.100.0000.01216.90
7.2.90.0030.01316.96
7.2.80.0120.00316.89
7.2.70.0070.00716.90
7.2.60.0060.00916.87
7.2.50.0060.00616.71
7.2.40.0070.01016.81
7.2.30.0060.01016.96
7.2.20.0070.01016.73
7.2.10.0130.00016.56
7.2.00.0040.01118.30
7.1.330.0030.01315.41
7.1.320.0170.00015.79
7.1.310.0030.01415.65
7.1.300.0100.00315.68
7.1.290.0060.00915.68
7.1.280.0040.01115.81
7.1.270.0070.00715.79
7.1.260.0130.00315.61
7.1.250.0000.01615.77
7.1.100.0060.00618.40
7.1.70.0060.00316.95
7.1.60.0160.00619.46
7.1.50.0070.01834.62
7.1.00.0000.10022.57
7.0.200.0030.00516.98
7.0.140.0030.07322.19
7.0.60.0230.06319.86
7.0.50.0070.08017.82
7.0.40.0030.05320.15
7.0.30.0200.07020.33
7.0.20.0270.07720.08
7.0.10.0130.08020.12
7.0.00.0000.04720.04
5.6.280.0030.07321.10
5.6.210.0070.04320.66
5.6.200.0070.05718.22
5.6.190.0000.04720.67
5.6.180.0370.06720.75
5.6.170.0200.04320.51
5.6.160.0100.08020.48
5.6.150.0070.08018.26
5.6.140.0030.04718.19
5.6.130.0000.05318.25
5.6.120.0000.04321.14
5.6.110.0000.09321.12
5.6.100.0130.05321.13
5.6.90.0070.06020.97
5.6.80.0070.03720.51
5.5.350.3800.05320.42
5.5.340.0030.05018.09
5.5.330.0100.07320.21
5.5.320.0170.04320.24
5.5.310.0200.05020.24
5.5.300.0170.07017.98
5.5.290.0000.04317.95
5.5.280.0100.08020.77
5.5.270.0000.09020.79
5.5.260.0300.06320.65
5.5.250.0070.06720.55
5.5.240.0100.07320.15
5.4.450.0970.03319.57
5.4.440.1270.03319.63
5.4.430.1330.03319.27
5.4.420.0500.04719.46
5.4.410.0000.03319.06
5.4.400.0470.03719.32
5.4.390.0530.04319.00
5.4.380.0370.06718.51
5.4.370.0470.05718.69
5.4.360.0200.07018.59
5.4.350.0400.05018.53
5.4.340.0200.06718.78
5.4.320.0060.04012.50
5.4.310.0050.04512.50
5.4.300.0100.03212.50
5.4.290.0030.04312.48
5.4.280.0090.03412.39
5.4.270.0090.03512.38
5.4.260.0090.04912.38
5.4.250.0100.05112.39
5.4.240.0080.05412.38
5.4.230.0130.05512.38
5.4.220.0070.05012.38
5.4.210.0050.03712.38
5.4.200.0110.03512.38
5.4.190.0070.03512.37
5.4.180.0080.03412.37
5.4.170.0040.03712.38
5.4.160.0040.03812.37
5.4.150.0030.04012.37
5.4.140.0050.03912.05
5.4.130.0070.04912.04
5.4.120.0060.03812.00
5.4.110.0040.03812.00
5.4.100.0060.03612.00
5.4.90.0070.03812.00
5.4.80.0060.04012.00
5.4.70.0050.03812.00
5.4.60.0060.03611.99
5.4.50.0080.03411.99
5.4.40.0050.04111.98
5.4.30.0080.03511.98
5.4.20.0020.03911.98
5.4.10.0100.03211.98
5.4.00.0060.03511.46
5.3.290.0080.03812.80
5.3.280.0080.03512.71
5.3.270.0050.04012.72
5.3.260.0070.04112.72
5.3.250.0080.03612.71
5.3.240.0060.03712.72
5.3.230.0060.03812.71
5.3.220.0080.03612.68
5.3.210.0100.04012.68
5.3.200.0070.03712.68
5.3.190.0110.03312.68
5.3.180.0070.03512.67
5.3.170.0050.03912.67
5.3.160.0080.03612.67
5.3.150.0030.04112.67
5.3.140.0080.03612.66
5.3.130.0110.03312.65
5.3.120.0080.03712.66
5.3.110.0060.05112.66
5.3.100.0050.03712.12
5.3.90.0070.03512.10
5.3.80.0080.03412.09
5.3.70.0130.07312.09
5.3.60.0090.04412.08
5.3.50.0070.06012.02
5.3.40.0090.03712.02
5.3.30.0050.03811.98
5.3.20.0080.03411.76
5.3.10.0060.03511.73
5.3.00.0060.03611.71
5.2.170.0090.0279.22
5.2.160.0060.0289.21
5.2.150.0040.0329.21
5.2.140.0060.0319.21
5.2.130.0080.0309.17
5.2.120.0100.0459.17
5.2.110.0100.0369.18
5.2.100.0100.0359.17
5.2.90.0060.0409.17
5.2.80.0060.0309.17
5.2.70.0080.0329.17
5.2.60.0050.0409.12
5.2.50.0040.0329.09
5.2.40.0030.0329.06
5.2.30.0060.0349.04
5.2.20.0070.0339.04
5.2.10.0060.0288.95
5.2.00.0060.0298.80
5.1.60.0040.0268.09
5.1.50.0040.0298.08
5.1.40.0020.0298.07
5.1.30.0040.0288.41
5.1.20.0090.0238.44
5.1.10.0050.0298.16
5.1.00.0060.0268.16
5.0.50.0030.0236.64
5.0.40.0070.0186.50
5.0.30.0070.0316.31
5.0.20.0060.0196.28
5.0.10.0050.0206.26
5.0.00.0060.0386.25
4.4.90.0060.0334.78
4.4.80.0030.0324.75
4.4.70.0060.0324.76
4.4.60.0050.0304.75
4.4.50.0050.0184.77
4.4.40.0050.0344.71
4.4.30.0030.0174.76
4.4.20.0080.0264.85
4.4.10.0070.0134.85
4.4.00.0030.0264.76
4.3.110.0030.0174.67
4.3.100.0040.0164.66
4.3.90.0050.0144.64
4.3.80.0030.0264.59
4.3.70.0020.0164.63
4.3.60.0050.0134.63
4.3.50.0040.0164.63
4.3.40.0040.0254.53
4.3.30.0040.0193.30
4.3.20.0020.0273.28
4.3.10.0050.0263.21
4.3.00.0070.01713.17

preferences:
49.55 ms | 401 KiB | 5 Q