3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getFromKeyPath(array $array, array $keys) { foreach ($keys as $index => $key) { if (!key_exists($key, $array)) { throw new Exception("key $key not found at level index $index"); } $array = $array[$key]; } return $array; } $array = ['a' => ['b' => ['c' => 'value'], 'd' => 3]]; $keys = ['a', 'b', 'c']; try { var_export(getFromKeyPath($array, $keys)); } catch (Exception $e) { echo $e->getMessage(); }

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.140.0110.00917.41
8.4.130.0090.01217.77
8.4.120.0130.00722.11
8.4.110.0140.00818.89
8.4.100.0120.00917.58
8.4.90.0100.01020.40
8.4.80.0140.00420.59
8.4.70.0130.00518.75
8.4.60.0100.01020.80
8.4.50.0110.00820.36
8.4.40.0100.01017.51
8.4.30.0130.00720.18
8.4.20.0090.01217.69
8.4.10.0060.00319.65
8.3.270.0110.00916.54
8.3.260.0120.00816.55
8.3.250.0130.00617.01
8.3.240.0090.00616.65
8.3.230.0100.01116.63
8.3.220.0120.00618.86
8.3.210.0050.00316.68
8.3.200.0060.00516.41
8.3.190.0090.00918.91
8.3.180.0110.00716.63
8.3.170.0090.00917.20
8.3.160.0130.00618.31
8.3.150.0150.00316.60
8.3.140.0000.01816.58
8.3.130.0050.00318.13
8.3.120.0090.00018.86
8.3.110.0060.00316.78
8.3.100.0150.00416.72
8.3.90.0050.00326.77
8.3.80.0070.00320.16
8.3.70.0160.00316.58
8.3.60.0110.00716.50
8.3.50.0070.00719.99
8.3.40.0070.00721.89
8.3.30.0070.00718.84
8.3.20.0080.00024.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0090.01017.03
8.2.280.0120.00620.29
8.2.270.0120.00617.07
8.2.260.0150.00418.95
8.2.250.0080.00018.39
8.2.240.0050.00516.44
8.2.230.0060.00320.94
8.2.220.0090.00024.06
8.2.210.0110.00026.77
8.2.200.0030.00616.63
8.2.190.0040.01116.63
8.2.180.0110.00425.92
8.2.170.0070.00718.91
8.2.160.0030.01022.96
8.2.150.0000.00825.66
8.2.140.0060.00324.66
8.2.130.0050.00226.16
8.2.120.0000.00826.16
8.2.110.0090.00021.05
8.2.100.0080.00317.83
8.2.90.0060.00317.88
8.2.80.0000.00818.73
8.2.70.0030.00617.50
8.2.60.0040.00417.63
8.2.50.0040.00417.63
8.2.40.0000.00819.88
8.2.30.0040.00418.23
8.2.20.0000.00720.46
8.2.10.0040.00417.78
8.2.00.0040.00419.32
8.1.330.0120.00816.02
8.1.320.0100.01016.29
8.1.310.0040.01118.31
8.1.300.0090.00018.65
8.1.290.0090.00030.84
8.1.280.0170.00725.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0110.00019.17
8.1.230.0070.00419.12
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00317.35
8.1.190.0080.00417.22
8.1.180.0040.00418.10
8.1.170.0000.00918.59
8.1.160.0000.00718.85
8.1.150.0040.00418.67
8.1.140.0000.00717.41
8.1.130.0030.00318.89
8.1.120.0110.00017.53
8.1.110.0070.00017.36
8.1.100.0050.00217.34
8.1.90.0000.00817.45
8.1.80.0000.01117.41
8.1.70.0070.00017.42
8.1.60.0060.00317.61
8.1.50.0000.00817.49
8.1.40.0000.00817.40
8.1.30.0000.00817.65
8.1.20.0040.00417.61
8.1.10.0030.00817.36
8.1.00.0110.00017.32
8.0.300.0040.00418.78
8.0.290.0090.00016.58
8.0.280.0000.00818.48
8.0.270.0060.00317.92
8.0.260.0000.00618.50
8.0.250.0030.00316.88
8.0.240.0050.00316.87
8.0.230.0030.00316.81
8.0.220.0040.00416.88
8.0.210.0070.00016.78
8.0.200.0030.00316.84
8.0.190.0040.00416.84
8.0.180.0050.00216.93
8.0.170.0030.00916.80
8.0.160.0040.00416.89
8.0.150.0040.00416.90
8.0.140.0070.00516.79
8.0.130.0130.00816.86
8.0.120.0180.00716.81
8.0.110.0180.00316.85
8.0.100.0120.00916.77
8.0.90.0160.00716.71
8.0.80.0140.00516.92
8.0.70.0190.00016.87
8.0.60.0180.00316.86
8.0.50.0170.00416.76
8.0.30.0190.00616.71
8.0.20.0170.00416.87
8.0.10.0150.00616.98
8.0.00.0120.00016.93
7.4.330.0030.00315.55
7.4.320.0000.00616.64
7.4.300.0030.00316.62
7.4.290.0040.00416.46
7.4.280.0100.00016.59
7.4.270.0040.00816.50
7.4.260.0170.00916.61
7.4.250.0190.00216.36
7.4.240.0130.00816.42
7.4.230.0140.00816.58
7.4.220.0160.00616.48
7.4.210.0120.00816.46
7.4.200.0130.00616.62
7.4.190.0090.00916.55
7.4.180.0110.00816.64
7.4.160.0120.00816.55
7.4.150.0140.00716.55
7.4.140.0150.00616.34
7.4.130.0170.00316.46
7.4.120.0180.00516.46
7.4.110.0130.00316.45
7.4.100.0100.00716.35
7.4.90.0150.00316.52
7.4.80.0090.01216.42
7.4.70.0180.00416.48
7.4.60.0170.00516.46
7.4.50.0160.00416.38
7.4.40.0140.00916.43
7.4.30.0180.00416.37
7.4.20.0180.00416.49
7.4.10.0190.00316.46
7.4.00.0100.01016.48
7.3.330.0150.00816.11
7.3.320.0190.00416.13
7.3.310.0210.00016.20
7.3.300.0140.01016.33
7.3.290.0210.00016.35
7.3.280.0150.00616.15
7.3.270.0150.00416.10
7.3.260.0130.00516.33
7.3.250.0180.00316.11
7.3.240.0150.00516.16
7.3.230.0170.00416.26
7.3.220.0130.00516.24
7.3.210.0100.00716.33
7.3.200.0190.00416.28
7.3.190.0120.00716.17
7.3.180.0140.00716.41
7.3.170.0200.00016.29
7.3.160.0030.00916.16
7.3.150.0100.00216.33
7.3.140.0090.00516.15
7.3.130.0140.00016.38

preferences:
29.56 ms | 403 KiB | 5 Q