3v4l.org

run code in 300+ PHP versions simultaneously
<?php function BinSearch($needle, $haystack){ $midpoint = count($haystack) / 2; $lower_half = array_slice($haystack, 0, $midpoint); $upper_half = array_slice($haystack, -$midpoint, count($haystack)); if($needle < $midpoint){ BinSearch($needle, $lower_half); } else if($needle > $midpoint){ BinSearch($needle, $upper_half); } if(count($haystack == 1)){ return true;} else if(count($haystack) == 0) { return false;} } $x = range(0,999); BinSearch(82,$x);

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.0210.00518.43
8.3.50.0260.01817.69
8.3.40.0530.00719.10
8.3.30.0200.01018.96
8.3.20.0180.00922.15
8.3.10.0240.00522.05
8.3.00.0160.00523.52
8.2.180.0350.01418.16
8.2.170.0280.00922.96
8.2.160.0310.01322.08
8.2.150.0000.02724.18
8.2.140.0130.00624.66
8.2.130.0140.00322.13
8.2.120.0310.00426.35
8.2.110.0250.00419.51
8.2.100.0110.00618.16
8.2.90.0000.01018.59
8.2.80.0000.01017.97
8.2.70.0100.00518.29
8.2.60.0050.00518.38
8.2.50.0080.00818.10
8.2.40.0160.00019.72
8.2.30.0110.00420.93
8.2.20.0140.00418.38
8.2.10.0000.01519.57
8.2.00.0100.00318.61
8.1.280.0210.01225.92
8.1.270.0070.00420.88
8.1.260.0100.00326.35
8.1.250.0070.00328.09
8.1.240.0260.00022.59
8.1.230.0110.00722.70
8.1.220.0060.00618.04
8.1.210.0080.00419.41
8.1.200.0060.00617.85
8.1.190.0100.00517.48
8.1.180.0050.01118.10
8.1.170.0070.01119.13
8.1.160.0040.01219.42
8.1.150.0050.00919.34
8.1.140.0160.00019.28
8.1.130.0090.00417.90
8.1.120.0070.00717.93
8.1.110.0030.00717.82
8.1.100.0040.00917.87
8.1.90.0120.00618.03
8.1.80.0070.00417.85
8.1.70.0100.00518.01
8.1.60.0080.00818.16
8.1.50.0120.00618.05
8.1.40.0000.01218.09
8.1.30.0050.01118.14
8.1.20.0040.00717.96
8.1.10.0120.00418.06
8.1.00.0080.01217.93
8.0.300.0280.01483.28
8.0.290.0310.01480.00
8.0.280.0230.02081.51
8.0.270.0290.01179.88
8.0.260.0310.01779.80
8.0.250.0230.01680.02
8.0.240.0320.00679.84
8.0.230.0400.01079.80
8.0.220.0280.01179.96
8.0.210.0330.00779.98
8.0.200.0260.01379.91
8.0.190.0320.01079.74
8.0.180.0290.01379.94
8.0.170.0190.02279.94
8.0.160.0210.02179.83
8.0.150.0190.02379.83
8.0.140.0240.01779.94
8.0.130.0710.020136.25
8.0.120.0270.01479.86
8.0.110.0250.01980.00
8.0.100.0230.01679.82
8.0.90.0140.02479.77
8.0.80.0490.03979.88
8.0.70.0160.02379.76
8.0.60.0190.01979.70
8.0.50.0280.01279.93
8.0.30.0610.02579.94
8.0.20.0680.04579.92
8.0.10.0270.01479.98
8.0.00.0750.04479.75
7.4.330.0220.01278.25
7.4.320.0280.01179.46
7.4.300.0230.01679.58
7.4.290.0280.01479.58
7.4.280.0340.01079.52
7.4.270.0370.01779.52
7.4.260.0220.01979.57
7.4.250.0200.02379.43
7.4.240.0240.01479.50
7.4.230.0310.00979.38
7.4.220.0240.01779.48
7.4.210.0580.03879.51
7.4.200.0240.01779.68
7.4.140.0620.04579.59
7.4.130.0690.03679.45
7.4.120.0690.04079.66
7.4.110.0510.05179.41
7.4.100.0600.04779.54
7.4.90.0710.03479.63
7.4.80.0450.05979.56
7.4.70.0700.06479.46
7.4.60.0570.04479.52
7.4.50.0300.03379.50
7.4.40.0780.05379.59
7.4.00.0330.03378.04
7.3.330.0480.020136.24
7.3.320.0370.033136.09
7.3.310.0200.01679.38
7.3.300.0170.02379.17
7.3.290.0690.03779.27
7.3.280.0700.05379.23
7.3.260.0650.05879.49
7.3.240.0710.03279.51
7.3.230.0500.05379.50
7.3.210.0890.05379.30
7.3.200.0640.05079.48
7.3.190.0950.03979.49
7.3.180.0810.05179.56
7.3.170.0530.02379.62
7.3.160.0860.05079.41
7.3.40.0530.02777.92
7.3.30.0620.01977.71
7.3.20.0440.01678.21
7.3.10.0290.01978.07
7.3.00.0290.02378.24
7.2.330.0590.04679.77
7.2.320.0610.05480.18
7.2.310.0690.03179.79
7.2.300.0540.05179.96
7.2.290.0590.04780.04
7.2.170.0510.02778.41
7.2.160.0620.01678.43
7.2.150.0310.01978.84
7.2.140.0400.01078.75
7.2.130.0260.02678.63
7.2.120.0300.01978.48
7.2.110.0320.02978.64
7.2.100.0460.03078.74
7.2.90.0350.02578.59
7.2.80.0300.03078.80
7.2.70.0270.02878.71
7.2.60.0330.02078.50
7.2.50.0400.01478.53
7.2.40.0370.01378.69
7.2.30.0420.02078.82
7.2.20.0350.02978.87
7.2.10.0310.02478.72
7.2.00.0420.01678.81
7.1.280.0380.02477.48
7.1.270.0410.02277.78
7.1.260.0380.01377.73
7.1.250.0180.03277.80

preferences:
59.29 ms | 401 KiB | 5 Q