3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "this is a long string"; $length = strlen($str); $dir = -1; $delta = $length; $maxlength = 12; while($delta){ $delta = $delta / 2; $length = $length + $dir * $delta; if($dir * (strlen(substr($str, 0, $length)) - $maxlength) > 0) $dir = -$dir; echo substr($str, 0, $length)." ". $delta. "\n"; } ?>

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.0230.00016.50
8.3.50.0070.01415.93
8.3.40.0090.01418.84
8.3.30.0120.00318.84
8.3.20.0080.00022.02
8.3.10.0030.00523.49
8.3.00.0100.00022.06
8.2.180.0140.00716.32
8.2.170.0370.00322.96
8.2.160.0130.00619.07
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0050.00321.11
8.2.120.0170.00326.35
8.2.110.0080.00321.05
8.2.100.0060.00618.03
8.2.90.0040.00419.23
8.2.80.0000.00917.97
8.2.70.0030.00617.50
8.2.60.0000.00817.93
8.2.50.0040.00418.10
8.2.40.0000.00820.63
8.2.30.0110.00421.09
8.2.20.0040.00418.20
8.2.10.0000.00818.27
8.2.00.0000.00718.27
8.1.280.0150.00725.92
8.1.270.0150.00422.04
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0060.00323.83
8.1.230.0080.00419.20
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0090.00317.22
8.1.190.0060.00317.35
8.1.180.0070.00318.10
8.1.170.0040.00419.03
8.1.160.0050.00319.07
8.1.150.0040.00420.75
8.1.140.0080.00019.71
8.1.130.0040.00418.88
8.1.120.0000.00717.52
8.1.110.0050.00517.40
8.1.100.0040.00417.46
8.1.90.0030.00517.44
8.1.80.0040.00817.45
8.1.70.0000.00717.43
8.1.60.0070.00017.55
8.1.50.0000.00717.48
8.1.40.0070.00717.59
8.1.30.0050.00817.67
8.1.20.0080.00017.56
8.1.10.0040.00717.54
8.1.00.0040.00417.57
8.0.300.0000.00918.77
8.0.290.0050.00316.63
8.0.280.0030.00518.46
8.0.270.0000.01117.26
8.0.260.0040.00416.82
8.0.250.0030.00516.91
8.0.240.0070.00416.85
8.0.230.0000.00816.85
8.0.220.0040.00416.88
8.0.210.0040.00416.92
8.0.200.0040.00416.96
8.0.190.0000.01016.98
8.0.180.0090.00316.93
8.0.170.0060.00316.91
8.0.160.0040.00416.97
8.0.150.0080.00016.79
8.0.140.0000.00916.83
8.0.130.0020.00513.39
8.0.120.0040.00416.89
8.0.110.0060.00316.68
8.0.100.0040.00416.96
8.0.90.0050.00316.80
8.0.80.0160.00816.88
8.0.70.0000.00816.90
8.0.60.0060.00316.80
8.0.50.0060.00316.87
8.0.30.0100.01616.96
8.0.20.0110.01517.40
8.0.10.0030.00616.95
8.0.00.0210.01016.78
7.4.330.0070.00015.55
7.4.320.0000.00716.48
7.4.300.0030.00516.46
7.4.290.0050.00516.51
7.4.280.0040.00416.61
7.4.270.0050.00316.66
7.4.260.0030.00616.63
7.4.250.0050.00216.52
7.4.240.0000.00816.52
7.4.230.0040.00416.55
7.4.220.0200.01416.56
7.4.210.0080.01516.49
7.4.200.0060.00316.63
7.4.160.0090.01416.34
7.4.150.0130.01017.40
7.4.140.0120.01717.86
7.4.130.0100.01616.43
7.4.120.0100.01616.40
7.4.110.0080.01416.42
7.4.100.0150.00716.20
7.4.90.0120.01216.39
7.4.80.0170.00719.39
7.4.70.0150.00616.37
7.4.60.0100.01016.59
7.4.50.0100.00716.67
7.4.40.0100.01016.17
7.4.30.0090.01316.40
7.4.00.0030.01314.67
7.3.330.0000.00713.07
7.3.320.0030.00313.16
7.3.310.0000.00816.26
7.3.300.0050.00316.17
7.3.290.0060.00316.37
7.3.280.0120.01116.31
7.3.270.0090.01517.40
7.3.260.0160.01316.29
7.3.250.0140.01316.36
7.3.240.0140.01016.57
7.3.230.0090.01516.52
7.3.210.0100.01316.57
7.3.200.0210.01116.48
7.3.190.0120.00916.35
7.3.180.0100.01016.42
7.3.170.0070.02316.31
7.3.160.0070.01416.26
7.2.330.0150.01216.39
7.2.320.0130.01016.26
7.2.310.0150.00616.73
7.2.300.0200.00716.63
7.2.290.0080.02016.73
7.2.60.0280.00816.92
7.2.00.0040.01419.48
7.1.200.0080.00815.78
7.1.100.0040.01118.30
7.1.70.0030.01217.16
7.1.60.0240.00735.27
7.1.50.0180.01834.71
7.1.40.0250.00834.49
7.1.30.0240.00934.80
7.1.20.0270.01034.54
7.1.10.0070.01116.48
7.1.00.0070.01016.54
7.0.200.0060.01016.70
7.0.190.0060.00916.84
7.0.180.0090.00916.27
7.0.170.0130.00516.16
7.0.160.0040.01216.20
7.0.150.0000.01416.39
7.0.140.0030.01416.21
7.0.130.0070.01016.41
7.0.120.0070.01316.49
7.0.110.0080.01116.26
7.0.100.0060.01216.29
7.0.90.0090.00916.46
7.0.80.0000.01916.18
7.0.70.0030.01316.34
7.0.60.0000.01616.17
7.0.50.0100.00616.27
7.0.40.0060.00916.36
7.0.30.0030.01716.52
7.0.20.0120.00416.30
7.0.10.0040.01516.32
7.0.00.0060.01316.33

preferences:
60.94 ms | 400 KiB | 5 Q