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) { $foundKey = $key; break; } } 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.0110.01119.85
8.4.150.0030.00014.05
8.4.140.0040.00517.43
8.4.130.0070.00217.64
8.4.120.0030.00520.50
8.4.110.0110.00622.35
8.4.100.0090.01217.65
8.4.90.0130.00718.75
8.4.80.0120.00717.77
8.4.70.0040.00517.62
8.4.60.0120.00920.46
8.4.50.0090.00318.52
8.4.40.0100.01019.38
8.4.30.0000.00819.02
8.4.20.0060.00318.99
8.4.10.0030.00617.84
8.3.280.0110.01018.26
8.3.270.0100.01016.92
8.3.260.0130.00616.49
8.3.250.0100.00718.93
8.3.240.0090.01016.63
8.3.230.0100.00916.59
8.3.220.0090.00917.22
8.3.210.0100.00416.53
8.3.200.0050.00316.61
8.3.190.0090.00917.16
8.3.180.0150.00518.49
8.3.170.0100.01016.95
8.3.160.0150.00418.30
8.3.150.0110.00718.25
8.3.140.0080.00017.36
8.3.130.0080.00018.32
8.3.120.0090.00920.59
8.3.110.0090.00016.27
8.3.100.0100.00618.59
8.3.90.0040.00426.77
8.3.80.0000.01216.38
8.3.70.0040.01416.58
8.3.60.0130.00916.75
8.3.50.0100.01018.02
8.3.40.0040.01118.90
8.3.30.0130.00318.68
8.3.20.0070.00024.18
8.3.10.0030.00524.66
8.3.00.0040.00426.16
8.2.290.0090.00720.42
8.2.280.0090.00918.61
8.2.270.0090.00917.19
8.2.260.0040.00416.48
8.2.250.0040.00418.16
8.2.240.0100.01019.07
8.2.230.0050.00520.94
8.2.220.0030.00737.54
8.2.210.0000.00826.77
8.2.200.0090.00316.35
8.2.190.0170.00316.58
8.2.180.0110.00725.92
8.2.170.0110.00319.11
8.2.160.0000.01422.96
8.2.150.0040.00425.66
8.2.140.0080.00624.66
8.2.130.0040.00426.16
8.2.120.0080.00020.01
8.2.110.0030.00620.51
8.2.100.0040.00817.72
8.2.90.0040.00418.03
8.2.80.0050.00317.97
8.2.70.0030.00517.75
8.2.60.0040.00417.63
8.2.50.0080.00017.63
8.2.40.0060.00319.47
8.2.30.0040.00718.06
8.2.20.0020.00518.00
8.2.10.0040.00419.30
8.2.00.0000.00719.29
8.1.330.0080.01123.66
8.1.320.0130.00616.34
8.1.310.0040.00418.29
8.1.300.0050.00920.37
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0060.00323.76
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0040.00420.91
8.1.230.0110.00022.76
8.1.220.0040.00417.74
8.1.210.0080.00018.87
8.1.200.0030.00717.35
8.1.190.0000.00817.40
8.1.180.0040.00718.10
8.1.170.0040.00417.62
8.1.160.0040.00418.88
8.1.150.0000.00718.88
8.1.140.0040.00418.89
8.1.130.0030.00520.00
8.1.120.0030.00517.37
8.1.110.0000.00817.40
8.1.100.0050.00317.47
8.1.90.0040.00417.33
8.1.80.0040.00417.35
8.1.70.0000.00817.30
8.1.60.0000.00817.64
8.1.50.0000.00817.53
8.1.40.0050.00317.41
8.1.30.0030.00617.71
8.1.20.0000.00817.59
8.1.10.0060.00617.58
8.1.00.0030.00617.49
8.0.300.0050.00320.02
8.0.290.0070.00416.75
8.0.280.0000.00718.35
8.0.270.0000.00818.01
8.0.260.0000.00818.51
8.0.250.0000.00716.94
8.0.240.0000.00717.01
8.0.230.0000.00816.86
8.0.220.0040.00416.90
8.0.210.0070.00016.90
8.0.200.0030.00316.94
8.0.190.0030.00616.86
8.0.180.0000.00716.89
8.0.170.0000.00816.83
8.0.160.0040.00416.85
8.0.150.0040.00416.90
8.0.140.0030.00716.77
8.0.130.0050.00013.29
8.0.120.0000.00816.81
8.0.110.0050.00216.77
8.0.100.0000.00716.92
8.0.90.0040.00316.79
8.0.80.0120.00416.89
8.0.70.0000.00716.77
8.0.60.0070.00016.90
8.0.50.0000.00816.89
8.0.30.0160.00016.94
8.0.20.0190.00916.92
8.0.10.0230.01217.07
8.0.00.0220.00816.99
7.4.330.0000.00515.55
7.4.320.0050.00316.48
7.4.300.0030.00316.42
7.4.290.0030.00316.46
7.4.280.0000.00716.39
7.4.270.0000.00816.36
7.4.260.0000.00713.30
7.4.250.0000.00716.48
7.4.240.0000.00716.52
7.4.230.0050.00216.39
7.4.220.0030.00316.68
7.4.210.0040.01116.38
7.4.200.0040.00416.61
7.4.160.0260.00316.60
7.4.150.0200.00616.43
7.4.140.0050.01316.63
7.4.130.0110.00816.40
7.4.120.0150.00416.48
7.4.110.0180.00916.36
7.4.100.0080.01116.41
7.4.90.0040.01116.37
7.4.80.0100.00716.49
7.4.70.0060.00916.55
7.4.60.0080.00816.57
7.4.50.0090.01216.33
7.4.40.0060.00916.39
7.4.30.0260.00916.33
7.4.20.0230.00316.50
7.4.10.0160.01016.43
7.4.00.0100.00716.38
7.3.330.0050.00316.27
7.3.320.0040.00413.07
7.3.310.0030.00316.26
7.3.300.0000.00616.36
7.3.290.0070.01016.28
7.3.280.0050.00816.32
7.3.270.0180.00016.36
7.3.260.0040.01316.35
7.3.250.0130.01016.29
7.3.240.0200.00816.27
7.3.230.0100.01116.30
7.3.220.0030.01216.25
7.3.210.0130.00716.21
7.3.200.0150.00616.30
7.3.190.0150.00616.15
7.3.180.0110.00616.27
7.3.170.0130.00416.28
7.3.160.0100.01416.31
7.3.150.0230.00716.32
7.3.140.0230.00516.16
7.3.130.0250.00816.36
7.3.120.0230.00616.25
7.3.110.0180.00916.14
7.3.100.0250.00416.15
7.3.90.0190.01916.46
7.3.80.0250.00516.23
7.3.70.0150.01316.40
7.3.60.0190.01016.48
7.3.50.0060.00916.37
7.3.40.0240.00316.42
7.3.30.0180.00716.46
7.3.20.0120.00416.53
7.3.10.0130.00316.36
7.3.00.0060.00916.36

preferences:
31.19 ms | 403 KiB | 5 Q