3v4l.org

run code in 300+ PHP versions simultaneously
<?php function findInArray(array $query, array $data) { foreach ($query as $key) { if (!array_key_exists($key, $data)) { // The key was not found, abort and return null return null; } // Since the key was found, move to next level $data =& $data[$key]; } return $data; } // Example response $response = [ 'client1' => [ 'dog' => [ 'Jack' => 'Some value', ], ] ]; // Define the query as an array $query = ['dog', 'Jack']; $result = findInArray($query, $response['client1']); var_dump($result);

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.0140.01217.72
8.4.130.0090.01217.86
8.4.120.0030.00520.53
8.4.110.0110.00818.95
8.4.100.0070.00217.69
8.4.90.0130.00617.60
8.4.80.0140.00719.30
8.4.70.0080.00417.70
8.4.60.0110.00918.63
8.4.50.0040.00519.76
8.4.40.0100.00719.37
8.4.30.0160.00320.41
8.4.20.0160.00319.70
8.4.10.0130.00718.78
8.3.270.0110.00816.72
8.3.260.0100.00816.86
8.3.250.0110.00718.78
8.3.240.0120.00816.57
8.3.230.0110.00916.75
8.3.220.0090.00817.04
8.3.210.0060.00418.34
8.3.200.0090.01016.52
8.3.190.0050.00318.86
8.3.180.0110.00916.78
8.3.170.0070.00719.04
8.3.160.0110.00418.63
8.3.150.0120.00620.84
8.3.140.0090.00916.63
8.3.130.0070.01118.52
8.3.120.0120.00418.85
8.3.110.0090.00020.94
8.3.100.0060.00324.06
8.3.90.0060.01326.77
8.3.80.0060.00316.75
8.3.70.0090.00616.58
8.3.60.0150.00316.50
8.3.50.0100.00720.34
8.3.40.0120.00319.16
8.3.30.0110.00419.52
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0090.01019.04
8.2.280.0110.00918.61
8.2.270.0130.00617.23
8.2.260.0130.00320.40
8.2.250.0040.00416.55
8.2.240.0000.01117.32
8.2.230.0060.00322.58
8.2.220.0000.00837.54
8.2.210.0040.00426.77
8.2.200.0070.00416.63
8.2.190.0140.00716.63
8.2.180.0120.00625.92
8.2.170.0140.00718.96
8.2.160.0090.00522.96
8.2.150.0070.00025.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0060.00322.26
8.2.100.0060.00617.75
8.2.90.0000.00819.20
8.2.80.0050.00317.97
8.2.70.0080.00017.63
8.2.60.0000.00818.16
8.2.50.0060.00318.07
8.2.40.0080.00418.34
8.2.30.0040.00418.30
8.2.20.0000.00820.31
8.2.10.0070.00018.04
8.2.00.0090.00019.23
8.1.330.0080.01116.36
8.1.320.0120.00616.07
8.1.310.0080.00016.87
8.1.300.0000.00816.04
8.1.290.0000.00918.88
8.1.280.0030.01325.92
8.1.270.0030.00518.71
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.01622.54
8.1.230.0060.00617.48
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00817.23
8.1.180.0090.00018.10
8.1.170.0050.00318.71
8.1.160.0000.00718.97
8.1.150.0080.00018.63
8.1.140.0000.00817.43
8.1.130.0000.00818.92
8.1.120.0030.00317.51
8.1.110.0060.00317.49
8.1.100.0000.00717.39
8.1.90.0030.00517.33
8.1.80.0030.00617.44
8.1.70.0000.00717.38
8.1.60.0000.00817.52
8.1.50.0000.00717.48
8.1.40.0100.00517.39
8.1.30.0150.01117.51
8.1.20.0230.00517.54
8.1.10.0230.00417.38
8.1.00.0220.00517.33
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.36
8.0.270.0000.00716.79
8.0.260.0000.00618.48
8.0.250.0000.00716.82
8.0.240.0030.00316.84
8.0.230.0030.00416.92
8.0.220.0030.00316.92
8.0.210.0000.00716.98
8.0.200.0030.00316.81
8.0.190.0040.00416.93
8.0.180.0050.00316.95
8.0.170.0160.00416.75
8.0.160.0180.00316.76
8.0.150.0180.00316.69
8.0.140.0170.00416.71
8.0.130.0150.00516.72
8.0.120.0130.00816.70
8.0.110.0170.00316.71
8.0.100.0180.00516.77
8.0.90.0150.00616.73
8.0.80.0160.00416.75
8.0.70.0160.00416.68
8.0.60.0180.00316.69
8.0.50.0180.00316.79
8.0.30.0140.00716.67
8.0.20.0140.00716.80
8.0.10.0150.00616.90
7.4.330.0050.00015.55
7.4.320.0000.00616.52
7.4.300.0000.00716.58
7.4.290.0030.00316.43
7.4.280.0180.00416.48
7.4.270.0200.00316.38
7.4.260.0190.00416.46
7.4.250.0190.00416.48
7.4.240.0130.00416.33
7.4.230.0160.00616.40
7.4.220.0150.00516.44
7.4.210.0130.00216.30
7.4.200.0140.00416.38
7.4.190.0190.00216.47
7.4.180.0150.00616.45
7.4.160.0200.00116.43
7.4.150.0160.00516.32
7.4.140.0150.00516.30
7.4.130.0160.00416.32
7.4.120.0160.00516.34
7.4.110.0160.00216.34
7.4.100.0130.00716.38
7.4.90.0150.00516.37
7.4.80.0110.00816.34
7.4.70.0150.00416.28
7.4.60.0160.00416.38
7.4.50.0160.00216.32
7.4.40.0070.00516.29
7.4.30.0120.00516.37
7.4.20.0160.00416.39
7.4.10.0140.00116.31
7.4.00.0090.00416.36

preferences:
77.85 ms | 403 KiB | 5 Q