3v4l.org

run code in 300+ PHP versions simultaneously
<?php function BinSearch($needle, $haystack){ (int) $m = ceil(count($haystack) / 2); $midpoint = $haystack[$m]; $lower_half = array_slice($haystack, 0, $m); $upper_half = array_slice($haystack, -$m, count($haystack)); if ($needle == $midpoint){ return $haystack[$needle]; } else if ($needle < $midpoint) { return BinSearch($needle, $lower_half); } else if ($needle > $midpoint) { return BinSearch($needle, $upper_half); } } $x = range(0,9999); BinSearch(8273,$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.0060.01618.61
8.3.50.0150.00517.96
8.3.40.0120.00319.43
8.3.30.0110.00419.34
8.3.20.0040.00422.37
8.3.10.0040.00422.35
8.3.00.0040.00422.35
8.2.180.0040.01117.25
8.2.170.0140.00022.96
8.2.160.0040.01121.03
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00422.31
8.2.120.0040.00426.35
8.2.110.0030.00621.00
8.2.100.0040.00818.66
8.2.90.0040.00819.69
8.2.80.0000.00818.43
8.2.70.0040.00418.55
8.2.60.0060.00318.66
8.2.50.0050.00318.25
8.2.40.0060.00319.67
8.2.30.0040.00421.00
8.2.20.0000.00818.74
8.2.10.0040.00419.88
8.2.00.0050.00218.59
8.1.270.0090.00021.40
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0100.00023.20
8.1.230.0040.00826.03
8.1.220.0030.00618.79
8.1.210.0090.00019.79
8.1.200.0000.01018.22
8.1.190.0040.00418.23
8.1.180.0030.00518.53
8.1.170.0060.00319.59
8.1.160.0000.00919.95
8.1.150.0020.00519.93
8.1.140.0000.00819.89
8.1.130.0030.00621.19
8.1.120.0000.00818.52
8.1.110.0030.00618.52
8.1.100.0080.00418.47
8.1.90.0060.00318.54
8.1.80.0050.00318.48
8.1.70.0030.00618.34
8.1.60.0000.00818.59
8.1.50.0030.00618.45
8.1.40.0030.00618.55
8.1.30.0030.00518.64
8.1.20.0030.00618.59
8.1.10.0000.00918.64
8.1.00.0000.00818.56
8.0.300.0050.00320.77
8.0.290.0060.00317.88
8.0.280.0000.00719.50
8.0.270.0040.00417.85
8.0.260.0000.00719.33
8.0.250.0000.00717.87
8.0.240.0080.00018.00
8.0.230.0050.00317.92
8.0.220.0000.00717.82
8.0.210.0000.00717.88
8.0.200.0000.00717.83
8.0.190.0030.00617.93
8.0.180.0040.00417.77
8.0.170.0030.00617.91
8.0.160.0000.00817.94
8.0.150.0040.00417.74
8.0.140.0040.00417.78
8.0.130.0070.00014.38
8.0.120.0040.00417.80
8.0.110.0050.00317.79
8.0.100.0080.00017.73
8.0.90.0030.00517.92
8.0.80.0070.01217.96
8.0.70.0000.00817.79
8.0.60.0000.00817.87
8.0.50.0040.00417.80
8.0.30.0110.01018.04
8.0.20.0100.01018.20
8.0.10.0030.00517.99
8.0.00.0140.00717.86
7.4.330.0000.00615.96
7.4.320.0040.00417.64
7.4.300.0030.00317.55
7.4.290.0040.00417.58
7.4.280.0080.00317.46
7.4.270.0000.00817.48
7.4.260.0000.00717.50
7.4.250.0030.00617.45
7.4.240.0030.00517.57
7.4.230.0000.00717.22
7.4.220.0090.00017.29
7.4.210.0060.01017.45
7.4.200.0040.00417.48
7.4.160.0110.01017.65
7.4.140.0210.00417.86
7.4.130.0110.00717.37
7.4.120.0070.01317.59
7.4.110.0070.01717.30
7.4.100.0060.01317.49
7.4.90.0070.01117.69
7.4.80.0040.01419.39
7.4.70.0110.00917.33
7.4.60.0100.01017.46
7.4.50.0070.01017.75
7.4.40.0090.01217.46
7.4.00.0120.00715.87
7.3.330.0000.00514.16
7.3.320.0060.00014.28
7.3.310.0000.00717.23
7.3.300.0030.00317.29
7.3.290.0070.00717.25
7.3.280.0090.00617.23
7.3.260.0110.00717.53
7.3.240.0100.00917.45
7.3.230.0070.01017.67
7.3.210.0130.00617.45
7.3.200.0070.01017.40
7.3.190.0150.00317.31
7.3.180.0140.00617.48
7.3.170.0100.00717.53
7.3.160.0170.00317.36
7.3.120.0100.00715.75
7.3.110.0030.01315.78
7.3.100.0070.00615.78
7.3.90.0030.01215.78
7.3.80.0100.00615.88
7.3.70.0100.00215.76
7.3.60.0060.00815.73
7.3.50.0080.00715.63
7.3.40.0060.01015.84
7.3.30.0110.00515.63
7.3.20.0070.00818.48
7.3.10.0070.00818.59
7.3.00.0070.00818.70
7.2.330.0080.01117.76
7.2.320.0120.01217.84
7.2.310.0120.00617.37
7.2.300.0120.01117.42
7.2.290.0090.00917.49
7.2.250.0020.01515.87
7.2.240.0090.00815.83
7.2.230.0070.01016.03
7.2.220.0060.00515.96
7.2.210.0090.00915.76
7.2.200.0040.00815.94
7.2.190.0050.00715.91
7.2.180.0090.00615.96
7.2.170.0070.01316.02
7.2.160.0010.01115.82
7.2.150.0110.00918.97
7.2.140.0040.01418.84
7.2.130.0020.01218.98
7.2.120.0100.01218.84
7.2.110.0110.00718.87
7.2.100.0130.00518.94
7.2.90.0110.00818.97
7.2.80.0070.01018.79
7.2.70.0070.00718.80
7.2.60.0100.00718.84
7.2.50.0090.01318.77
7.2.40.0080.00918.89
7.2.30.0090.01419.00
7.2.20.0100.00818.81
7.2.10.0100.01118.59
7.2.00.0110.00718.73
7.1.330.0080.00517.97
7.1.320.0040.00717.88
7.1.310.0080.00617.86
7.1.300.0100.00317.84
7.1.290.0050.00917.79
7.1.280.0060.00917.81
7.1.270.0100.00617.85
7.1.260.0090.00617.95
7.1.250.0070.00517.76

preferences:
68.74 ms | 400 KiB | 5 Q