3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0, 0, 4, 4, 5, 7]; for ($test = -1; $test < 9; ++$test) { echo "\ntest search for $test: "; $foundKey = 'not found'; foreach ($array as $key => $value) { if ($value > $test) { break; } $foundKey = $key; } echo "index = $foundKey"; if (isset($array[$foundKey])) { echo ", value = {$array[$foundKey]}"; } }

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.5.00.0150.00619.91
8.4.150.0020.00014.05
8.4.140.0120.00917.50
8.4.130.0130.00718.90
8.4.120.0110.00924.14
8.4.110.0130.00618.91
8.4.100.0140.00717.65
8.4.90.0140.00720.38
8.4.80.0080.01218.72
8.4.70.0130.00717.53
8.4.60.0110.00918.76
8.4.50.0090.00718.62
8.4.40.0120.00919.52
8.4.30.0030.01320.83
8.4.20.0000.01918.95
8.4.10.0040.00417.84
8.3.280.0110.01018.18
8.3.270.0110.00916.34
8.3.260.0040.00416.35
8.3.250.0120.00618.72
8.3.240.0110.00917.41
8.3.230.0110.00816.54
8.3.220.0020.00619.04
8.3.210.0040.00416.82
8.3.200.0140.00516.66
8.3.190.0090.01017.32
8.3.180.0130.00617.11
8.3.170.0060.01320.73
8.3.160.0130.00317.32
8.3.150.0040.01818.88
8.3.140.0080.00018.39
8.3.130.0030.00518.16
8.3.120.0060.00318.97
8.3.110.0100.00020.94
8.3.100.0060.00318.55
8.3.90.0050.00326.77
8.3.80.0070.00316.63
8.3.70.0040.01116.58
8.3.60.0090.00618.30
8.3.50.0070.01118.20
8.3.40.0040.01118.73
8.3.30.0130.00318.67
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0120.00616.58
8.2.280.0070.00118.43
8.2.270.0060.00617.13
8.2.260.0040.01418.79
8.2.250.0030.00616.78
8.2.240.0030.00718.84
8.2.230.0060.00322.58
8.2.220.0000.00824.06
8.2.210.0080.00026.77
8.2.200.0030.00616.50
8.2.190.0090.00616.58
8.2.180.0120.00425.92
8.2.170.0110.00319.09
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0080.00021.01
8.2.110.0040.00722.25
8.2.100.0100.00318.03
8.2.90.0000.00817.75
8.2.80.0030.00518.86
8.2.70.0050.00317.62
8.2.60.0000.00818.04
8.2.50.0040.00418.05
8.2.40.0030.00519.75
8.2.30.0020.00518.00
8.2.20.0070.00018.04
8.2.10.0000.00719.41
8.2.00.0040.00419.29
8.1.330.0100.00816.11
8.1.320.0110.00816.18
8.1.310.0080.00018.58
8.1.300.0120.00017.82
8.1.290.0060.00330.84
8.1.280.0070.00725.92
8.1.270.0060.00323.85
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00423.82
8.1.230.0080.00417.96
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.22
8.1.190.0030.00517.22
8.1.180.0000.00918.10
8.1.170.0000.00818.65
8.1.160.0030.00519.07
8.1.150.0000.00718.94
8.1.140.0040.00418.93
8.1.130.0070.00020.13
8.1.120.0050.00317.52
8.1.110.0000.00717.34
8.1.100.0000.00717.46
8.1.90.0070.00017.43
8.1.80.0050.00317.45
8.1.70.0050.00617.47
8.1.60.0040.00417.55
8.1.50.0000.01217.53
8.1.40.0000.00817.51
8.1.30.0000.00817.56
8.1.20.0050.00517.53
8.1.10.0000.00717.43
8.1.00.0000.00717.48
8.0.300.0070.00018.77
8.0.290.0080.00016.75
8.0.280.0050.00318.38
8.0.270.0030.00317.91
8.0.260.0040.00418.40
8.0.250.0070.00016.96
8.0.240.0000.00716.86
8.0.230.0070.00016.95
8.0.220.0030.00316.80
8.0.210.0050.00216.84
8.0.200.0070.00016.82
8.0.190.0040.00416.86
8.0.180.0000.00716.93
8.0.170.0030.00616.79
8.0.160.0070.00016.90
8.0.150.0040.00416.71
8.0.140.0000.00716.91
8.0.130.0030.00313.31
8.0.120.0050.00216.83
8.0.110.0040.00416.90
8.0.100.0030.00516.69
8.0.90.0040.00416.89
8.0.80.0060.01316.86
8.0.70.0040.00416.82
8.0.60.0040.00416.84
8.0.50.0030.00516.68
8.0.30.0230.00716.90
8.0.20.0160.01316.93
8.0.10.0170.01017.06
8.0.00.0130.02116.97
7.4.330.0040.00015.55
7.4.320.0030.00316.60
7.4.300.0030.00316.54
7.4.290.0040.00416.43
7.4.280.0110.00016.63
7.4.270.0040.00416.61
7.4.260.0030.00313.38
7.4.250.0060.00316.60
7.4.240.0030.00316.46
7.4.230.0030.00316.50
7.4.220.0000.00716.44
7.4.210.0100.00416.52
7.4.200.0040.00416.45
7.4.160.0130.01116.69
7.4.150.0040.02116.39
7.4.140.0120.00916.55
7.4.130.0150.00816.56
7.4.120.0150.00816.38
7.4.110.0180.00916.44
7.4.100.0140.01116.55
7.4.90.0190.01016.39
7.4.80.0180.01216.43
7.4.70.0260.00816.39
7.4.60.0270.00616.39
7.4.50.0230.01116.28
7.4.40.0190.00516.40
7.4.30.0080.01316.29
7.4.20.0080.01516.32
7.4.10.0150.01516.29
7.4.00.0080.01216.47
7.3.330.0070.00016.15
7.3.320.0000.00513.15
7.3.310.0080.00016.21
7.3.300.0070.00016.36
7.3.290.0090.00616.31
7.3.280.0160.00716.33
7.3.270.0130.01116.37
7.3.260.0120.01716.27
7.3.250.0070.01016.25
7.3.240.0190.00616.37
7.3.230.0180.00416.27
7.3.220.0290.01016.27
7.3.210.0160.01616.21
7.3.200.0230.01016.30
7.3.190.0180.01516.28
7.3.180.0370.01216.28
7.3.170.0110.01416.21
7.3.160.0080.01216.14
7.3.150.0120.00816.21
7.3.140.0240.01316.32
7.3.130.0270.00916.22
7.3.120.0270.00616.28
7.3.110.0290.00916.26
7.3.100.0120.00916.18
7.3.90.0100.01016.50
7.3.80.0120.00916.26
7.3.70.0090.00616.30
7.3.60.0130.00716.39
7.3.50.0130.00716.33
7.3.40.0060.01316.32
7.3.30.0070.00916.50
7.3.20.0040.01216.39
7.3.10.0130.00716.32
7.3.00.0040.01816.45

preferences:
34.59 ms | 403 KiB | 5 Q