3v4l.org

run code in 300+ PHP versions simultaneously
<?php function findInArray($query, $data) { foreach ($query as $key) { if (!array_key_exists($key, $data)) { // The key was not found, set data to null and abort $data = null; break; } // Set data to the next level $data =& $data[$key]; } return $data; } $response = [ 'client1' => [ 'dog' => [ 'Jack' => 'Some value', 'Jack1' => 'Some value1', 'Jack2' => [ 'name' => 'Yes!', 'working' => [ 0 => 'Nope...', 1 => 'Seems like it!' ], ], ], ], 'client2' => [ 'cat' => [ 'Stacy' => 'Some other value', ], ], ]; $query = ['dog', 'Jack2', 'working', 1]; var_dump(findInArray($query, $response['client1']));

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.0060.00220.37
8.5.00.0150.00819.80
8.4.150.0030.00014.05
8.4.140.0100.01117.71
8.4.130.0110.00917.49
8.4.120.0120.00720.40
8.4.110.0120.00818.73
8.4.100.0110.00917.73
8.4.90.0150.00617.89
8.4.80.0030.00517.65
8.4.70.0120.01217.79
8.4.60.0120.00818.56
8.4.50.0060.01017.90
8.4.40.0100.01319.40
8.4.30.0100.01020.30
8.4.20.0070.01319.54
8.4.10.0070.01118.86
8.3.280.0130.00818.29
8.3.270.0110.00816.71
8.3.260.0060.00316.51
8.3.250.0130.00618.79
8.3.240.0120.00816.55
8.3.230.0070.00416.75
8.3.220.0120.00418.58
8.3.210.0100.00416.80
8.3.200.0040.00416.57
8.3.190.0050.00317.32
8.3.180.0060.01220.62
8.3.170.0030.01116.45
8.3.160.0130.00616.48
8.3.150.0130.00617.17
8.3.140.0120.00316.42
8.3.130.0030.01716.44
8.3.120.0000.01018.80
8.3.110.0100.00020.94
8.3.100.0030.00524.06
8.3.90.0080.00026.77
8.3.80.0060.00316.63
8.3.70.0140.00416.58
8.3.60.0080.00616.50
8.3.50.0130.00318.36
8.3.40.0070.00719.09
8.3.30.0110.00419.33
8.3.20.0000.00724.18
8.3.10.0000.00824.66
8.3.00.0080.00026.16
8.2.290.0070.00218.98
8.2.280.0050.00418.27
8.2.270.0120.00816.48
8.2.260.0120.00319.11
8.2.250.0150.00316.65
8.2.240.0060.00316.94
8.2.230.0030.00622.58
8.2.220.0090.00037.54
8.2.210.0060.00926.77
8.2.200.0000.01516.38
8.2.190.0110.00416.58
8.2.180.0130.00325.92
8.2.170.0090.00618.95
8.2.160.0090.00622.96
8.2.150.0060.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0030.00622.20
8.2.100.0070.00417.91
8.2.90.0000.00817.75
8.2.80.0040.00418.61
8.2.70.0060.00317.63
8.2.60.0030.00518.04
8.2.50.0040.00417.98
8.2.40.0070.00417.95
8.2.30.0040.00418.19
8.2.20.0000.00720.43
8.2.10.0040.00418.14
8.2.00.0020.00519.36
8.1.330.0120.00716.12
8.1.320.0100.00916.00
8.1.310.0060.00618.50
8.1.300.0040.01118.11
8.1.290.0060.00318.88
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0090.00023.73
8.1.230.0060.00621.02
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0040.00417.10
8.1.180.0030.00618.10
8.1.170.0060.00317.62
8.1.160.0000.00718.89
8.1.150.0040.00418.52
8.1.140.0040.00417.32
8.1.130.0000.00718.81
8.1.120.0000.00917.31
8.1.110.0030.00517.34
8.1.100.0060.00317.45
8.1.90.0040.00417.40
8.1.80.0000.00817.39
8.1.70.0030.00317.42
8.1.60.0040.00417.48
8.1.50.0040.00417.50
8.1.40.0000.00817.43
8.1.30.0190.00517.56
8.1.20.0190.00617.60
8.1.10.0110.00717.42
8.1.00.0070.00617.30
8.0.300.0060.00318.77
8.0.290.0040.00416.75
8.0.280.0000.00818.46
8.0.270.0070.00016.74
8.0.260.0060.00018.33
8.0.250.0070.00017.04
8.0.240.0070.00017.02
8.0.230.0000.00816.94
8.0.220.0000.00716.91
8.0.210.0060.00316.90
8.0.200.0030.00316.95
8.0.190.0030.00516.86
8.0.180.0040.00416.95
8.0.170.0050.00316.87
8.0.160.0070.00216.78
8.0.150.0140.00516.83
8.0.140.0140.00716.77
8.0.130.0130.00616.71
8.0.120.0180.00316.68
8.0.110.0170.00316.75
8.0.100.0170.00316.64
8.0.90.0190.00016.63
8.0.80.0180.00416.68
8.0.70.0130.00616.71
8.0.60.0160.00316.77
8.0.50.0170.00416.75
8.0.30.0120.00816.74
8.0.20.0160.00316.75
8.0.10.0080.01216.92
7.4.330.0020.00215.55
7.4.320.0060.00016.65
7.4.300.0040.00416.58
7.4.290.0070.00016.42
7.4.280.0030.00316.51
7.4.270.0170.00616.57
7.4.260.0110.00816.33
7.4.250.0120.01216.54
7.4.240.0160.00916.52
7.4.230.0180.00516.59
7.4.220.0180.00016.50
7.4.210.0060.01316.51
7.4.200.0180.00016.48
7.4.190.0200.00016.45
7.4.180.0160.00316.55
7.4.160.0080.00516.18
7.4.150.0070.00316.44
7.4.140.0040.00916.20
7.4.130.0160.00416.26
7.4.120.0130.00416.41
7.4.110.0170.00316.42
7.4.100.0100.01016.29
7.4.90.0140.00616.28
7.4.80.0110.00016.40
7.4.70.0160.00616.32
7.4.60.0140.00516.31
7.4.50.0100.00716.32
7.4.40.0110.00716.33
7.4.30.0160.00316.28
7.4.20.0130.00716.36
7.4.10.0140.00616.35
7.4.00.0150.00516.29

preferences:
30.54 ms | 403 KiB | 5 Q