3v4l.org

run code in 300+ PHP versions simultaneously
<?php function greatestIndexWhereValueLessThan($haystack, $needle) { foreach ($haystack as $key => $value) { if ($value >= $needle) { break; } } return $key ?? null; } echo greatestIndexWhereValueLessThan([30, 60, 90, 120, 360], 73); echo "\n"; echo greatestIndexWhereValueLessThan([30, 60, 90, 120, 360], 4);

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.4.130.0130.00718.72
8.4.120.0150.00520.75
8.4.110.0110.00720.62
8.4.100.0100.01117.77
8.4.90.0110.00720.61
8.4.80.0090.00919.07
8.4.70.0090.00718.90
8.4.60.0130.00822.33
8.4.50.0090.01124.03
8.4.40.0120.00320.55
8.4.30.0130.00320.41
8.4.20.0100.01017.80
8.4.10.0060.00322.28
8.3.260.0140.00716.55
8.3.250.0120.00517.37
8.3.240.0140.00516.51
8.3.230.0120.00716.62
8.3.220.0120.00618.95
8.3.210.0120.00416.70
8.3.200.0020.00716.43
8.3.190.0140.00517.09
8.3.180.0080.00718.32
8.3.170.0070.01116.64
8.3.160.0180.00016.63
8.3.150.0060.00917.05
8.3.140.0080.00018.29
8.3.130.0030.00616.43
8.3.120.0060.00619.04
8.3.110.0090.00620.94
8.3.100.0050.00324.06
8.3.90.0090.00326.77
8.3.80.0040.00416.38
8.3.70.0090.00616.75
8.3.60.0080.00816.50
8.3.50.0100.00718.37
8.3.40.0030.01020.34
8.3.30.0140.00018.54
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0000.00726.16
8.2.290.0140.00516.95
8.2.280.0110.00819.95
8.2.270.0080.00016.82
8.2.260.0120.00620.36
8.2.250.0090.00016.69
8.2.240.0080.00017.08
8.2.230.0080.00022.58
8.2.220.0090.00037.54
8.2.210.0000.00726.77
8.2.200.0060.00318.29
8.2.190.0100.01016.58
8.2.180.0150.00925.92
8.2.170.0070.00718.67
8.2.160.0070.00722.96
8.2.150.0050.00225.66
8.2.140.0050.00224.66
8.2.130.0080.00026.16
8.2.120.0040.00419.88
8.2.110.0040.00419.29
8.2.100.0070.00718.16
8.2.90.0040.00419.27
8.2.80.0030.00617.97
8.2.70.0080.00017.63
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0090.00019.95
8.2.30.0000.00718.02
8.2.20.0000.00719.13
8.2.10.0000.00718.08
8.2.00.0000.00719.13
8.1.330.0110.00617.98
8.1.320.0080.00915.94
8.1.310.0090.00618.48
8.1.300.0050.00515.97
8.1.290.0080.00430.84
8.1.280.0070.01025.92
8.1.270.0070.00024.66
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0030.00722.68
8.1.230.0110.00022.21
8.1.220.0070.00417.79
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0000.00817.23
8.1.180.0030.00618.10
8.1.170.0050.00318.52
8.1.160.0040.00418.88
8.1.150.0030.00518.60
8.1.140.0070.00017.45
8.1.130.0030.00317.46
8.1.120.0000.00817.46
8.1.110.0070.00017.34
8.1.100.0000.00717.34
8.1.90.0030.00517.44
8.1.80.0080.00817.46
8.1.70.0170.00017.44
8.1.60.0150.00417.50
8.1.50.0060.01117.36
8.1.40.0090.00517.51
8.1.30.0110.00017.45
8.1.20.0100.00017.57
8.1.10.0130.00517.50
8.1.00.0130.00417.39
8.0.300.0040.00418.77
8.0.290.0080.00016.63
8.0.280.0050.00218.51
8.0.270.0070.00016.74
8.0.260.0000.00816.82
8.0.250.0040.00416.92
8.0.240.0000.00717.00
8.0.230.0070.00316.84
8.0.220.0100.00516.81
8.0.210.0050.00916.80
8.0.200.0070.00716.80
8.0.190.0070.00716.91
8.0.180.0100.00516.76
8.0.170.0120.00216.93
8.0.160.0070.00716.97
8.0.150.0050.00916.57
8.0.140.0140.00016.84
8.0.130.0090.00616.96
8.0.120.0050.01016.78
8.0.110.0140.00016.83
8.0.100.0050.01116.82
8.0.90.0050.00916.90
8.0.80.0120.00316.82
8.0.70.0110.00416.93
8.0.60.0130.00316.92
8.0.50.0070.01016.86
8.0.30.0140.00016.91
8.0.20.0040.01116.92
8.0.10.0070.00416.96
7.4.330.0020.00215.55
7.4.320.0030.00316.58
7.4.300.0050.00516.26
7.4.290.0040.00916.39
7.4.280.0170.00016.38
7.4.270.0140.00416.46
7.4.260.0130.00316.49
7.4.250.0080.00916.45
7.4.240.0130.00316.54
7.4.230.0080.00816.44
7.4.220.0090.00616.47
7.4.210.0120.00316.55
7.4.200.0120.00316.29
7.4.190.0100.00516.47
7.4.180.0120.00216.50
7.4.160.0150.00016.59
7.4.150.0110.00316.49
7.4.140.0130.00016.40
7.4.130.0080.00416.46
7.4.120.0090.00416.34
7.4.110.0120.00016.41
7.4.100.0050.00516.28
7.4.90.0000.00816.41
7.4.80.0020.00516.45
7.4.70.0020.00716.22
7.4.60.0000.00616.51
7.4.50.0060.00016.42
7.4.40.0030.00316.28
7.4.30.0000.00616.41
7.4.20.0000.00716.23
7.4.10.0000.00716.34
7.4.00.0000.00816.48

preferences:
79.67 ms | 403 KiB | 5 Q