3v4l.org

run code in 300+ PHP versions simultaneously
<?php $this_method = ['foo' => ['bar' => ['bard' => ['food' => 'barf']]]]; $indexes = ['foo', 'bar', 'bard']; function getBySuccessiveKeys(array $haystack, array $keys) { foreach ($keys as $key) { if (!key_exists($key, $haystack)) { break; } $haystack = $haystack[$key]; } return $haystack; } var_export(getBySuccessiveKeys($this_method, $indexes));

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.10.0090.00919.52
8.5.00.0120.01020.07
8.4.160.0120.00923.93
8.4.150.0020.00014.05
8.4.140.0120.00917.40
8.4.130.0100.01217.77
8.4.120.0140.00620.61
8.4.110.0120.00922.35
8.4.100.0100.01117.64
8.4.90.0160.00418.68
8.4.80.0150.00519.73
8.4.70.0150.00717.80
8.4.60.0060.00518.72
8.4.50.0140.00919.71
8.4.40.0130.00322.34
8.4.30.0130.00623.66
8.4.20.0080.00819.50
8.4.10.0030.00722.02
8.3.280.0100.01018.38
8.3.270.0120.00716.53
8.3.260.0040.00416.71
8.3.250.0120.00618.80
8.3.240.0020.00616.46
8.3.230.0100.00916.70
8.3.220.0110.00717.20
8.3.210.0090.00616.62
8.3.200.0080.00316.76
8.3.190.0060.00217.15
8.3.180.0100.00816.41
8.3.170.0150.00318.66
8.3.160.0100.00016.68
8.3.150.0100.01017.03
8.3.140.0090.00920.70
8.3.130.0030.00618.44
8.3.120.0080.00019.03
8.3.110.0040.00420.94
8.3.100.0040.00416.53
8.3.90.0040.00420.12
8.3.80.0060.00317.97
8.3.70.0100.01018.27
8.3.60.0120.00316.32
8.3.50.0090.00916.42
8.3.40.0170.00321.89
8.3.30.0090.00618.71
8.3.20.0000.00824.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0080.01220.59
8.2.280.0060.00220.13
8.2.270.0070.01117.06
8.2.260.0050.00320.50
8.2.250.0110.00716.43
8.2.240.0080.00018.99
8.2.230.0030.00522.58
8.2.220.0000.00924.06
8.2.210.0070.00426.77
8.2.200.0000.00918.54
8.2.190.0120.00316.75
8.2.180.0100.01018.51
8.2.170.0040.01518.92
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.77
8.2.110.0040.00722.26
8.2.100.0060.00617.84
8.2.90.0040.00418.10
8.2.80.0030.00618.29
8.2.70.0050.00317.75
8.2.60.0140.00517.38
8.2.50.0090.00917.50
8.2.40.0140.00217.38
8.2.30.0120.00517.63
8.2.20.0170.00017.38
8.2.10.0120.00617.38
8.2.00.0100.00517.38
8.1.330.0090.00121.84
8.1.320.0090.00816.21
8.1.310.0080.00016.60
8.1.300.0000.00818.57
8.1.290.0080.00018.88
8.1.280.0000.01425.92
8.1.270.0090.00022.14
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00623.84
8.1.230.0060.00622.68
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0000.00817.35
8.1.190.0080.00816.75
8.1.180.0170.00017.10
8.1.170.0120.00417.25
8.1.160.0130.00317.48
8.1.150.0090.00917.38
8.1.140.0140.00317.50
8.1.130.0180.00016.88
8.1.120.0100.00617.48
8.1.110.0130.00317.25
8.1.100.0100.00617.47
8.1.90.0070.01117.13
8.1.80.0120.00617.35
8.1.70.0130.00517.38
8.1.60.0150.00317.25
8.1.50.0130.00417.38
8.1.40.0120.00617.25
8.1.30.0110.00817.13
8.1.20.0120.00617.13
8.1.10.0100.00717.38
8.1.00.0130.00417.34
8.0.300.0070.00020.07
8.0.290.0040.00416.58
8.0.280.0080.00816.52
8.0.270.0140.00316.52
8.0.260.0140.00316.52
8.0.250.0100.00716.72
8.0.240.0130.00316.63
8.0.230.0060.01116.52
8.0.220.0110.00516.52
8.0.210.0140.00416.52
8.0.200.0160.00016.60
8.0.190.0000.01616.52
8.0.180.0110.00616.75
8.0.170.0120.00416.73
8.0.160.0180.00016.63
8.0.150.0060.01216.63
8.0.140.0130.00316.52
8.0.130.0130.00416.52
8.0.120.0060.00916.74
8.0.110.0120.00316.61
8.0.100.0100.00716.52
8.0.90.0110.00516.63
8.0.80.0130.00316.75
8.0.70.0160.00016.52
8.0.60.0110.00516.63
8.0.50.0120.00516.75
8.0.30.0160.00016.52
8.0.20.0120.00516.52
8.0.10.0150.00016.52

preferences:
106.25 ms | 403 KiB | 5 Q