3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["farm"=> [ "horse"=> [ "rabbit"=> [ "name"=> "alan", "age"=> "21", "size"=> "166", "gender"=> "f" ], ] ] ]; function createList($array, $keySearch, $path=null) { $result = []; foreach ($array as $key => $item) { $basePath = $path === null ? $key : $path. "/" . $key; if (stripos($key, $keySearch) !== false && is_array($item)){ $result[] = ['key' => $key, 'basePath' => $basePath]; } if(is_array($item)) $result = array_merge($result, createList($item, $keySearch, $basePath)); } return $result; } $keySearch = 'a'; $res = createList($array, $keySearch); echo '<pre>'; print_r($res);

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.3.70.0080.00816.63
8.3.60.0070.01118.30
8.3.50.0110.00722.00
8.3.40.0150.00018.98
8.3.30.0070.00718.84
8.3.20.0080.00021.07
8.3.10.0090.00021.72
8.3.00.0000.00820.68
8.2.190.0140.00716.75
8.2.180.0120.00918.54
8.2.170.0100.00722.96
8.2.160.0100.00320.47
8.2.150.0000.00824.18
8.2.140.0000.00724.66
8.2.130.0080.00019.77
8.2.120.0080.00026.35
8.2.110.0030.00620.58
8.2.100.0110.00017.91
8.2.90.0040.00418.03
8.2.80.0030.00518.22
8.2.70.0050.00317.50
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0050.00322.15
8.2.30.0030.00519.28
8.2.20.0050.00317.71
8.2.10.0000.00718.07
8.2.00.0040.00818.16
8.1.280.0130.00625.92
8.1.270.0040.00424.02
8.1.260.0070.00028.09
8.1.250.0070.00028.09
8.1.240.0130.01023.69
8.1.230.0050.00523.85
8.1.220.0080.00017.74
8.1.210.0000.00918.97
8.1.200.0060.00317.22
8.1.190.0000.00817.22
8.1.180.0050.00318.10
8.1.170.0040.00418.68
8.1.160.0000.00719.03
8.1.150.0030.00518.83
8.1.140.0070.00019.59
8.1.130.0080.00017.65
8.1.120.0050.00217.50
8.1.110.0000.00717.38
8.1.100.0040.00417.51
8.1.90.0080.00017.39
8.1.80.0070.00017.51
8.1.70.0060.00317.50
8.1.60.0020.00517.56
8.1.50.0050.00317.56
8.1.40.0000.00717.44
8.1.30.0030.00617.54
8.1.20.0080.00017.64
8.1.10.0000.00817.65
8.1.00.0080.00017.45
8.0.300.0040.00419.90
8.0.290.0070.00016.75
8.0.280.0000.00718.38
8.0.270.0030.00316.86
8.0.260.0030.00317.29
8.0.250.0000.00717.02
8.0.240.0000.00816.88
8.0.230.0030.00716.99
8.0.220.0000.00716.84
8.0.210.0000.00816.86
8.0.200.0000.01016.94
8.0.190.0040.00416.96
8.0.180.0040.00416.88
8.0.170.0040.00416.99
8.0.160.0030.00316.80
8.0.150.0000.00716.82
8.0.140.0040.00416.90
8.0.130.0030.00313.42
8.0.120.0050.00316.78
8.0.110.0050.00316.80
8.0.100.0030.00316.88
8.0.90.0030.00516.80
8.0.80.0120.00316.92
8.0.70.0030.00616.80
8.0.60.0000.00816.79
8.0.50.0050.00216.99
8.0.30.0120.00817.09
8.0.20.0110.00717.40
8.0.10.0040.00417.07
8.0.00.0070.01116.63
7.4.330.0020.00216.67
7.4.320.0040.00416.46
7.4.300.0070.00016.43
7.4.290.0070.00416.66
7.4.280.0080.00016.61
7.4.270.0070.00016.67
7.4.260.0040.00416.45
7.4.250.0070.00016.45
7.4.240.0000.00916.55
7.4.230.0000.00716.71
7.4.220.0070.01116.55
7.4.210.0050.01216.58
7.4.200.0000.00816.64
7.4.160.0100.00616.45
7.4.150.0080.00817.40
7.4.140.0110.00917.86
7.4.130.0030.01716.57
7.4.120.0070.01016.65
7.4.110.0070.01116.76
7.4.100.0100.01016.54
7.4.90.0150.00916.32
7.4.80.0070.01019.39
7.4.70.0090.00916.56
7.4.60.0070.01016.45
7.4.50.0070.00716.60
7.4.40.0110.00816.63
7.4.30.0090.01216.53
7.4.00.0060.01215.10
7.3.330.0020.00213.40
7.3.320.0050.00013.39
7.3.310.0040.00416.29
7.3.300.0000.00716.26
7.3.290.0030.00316.35
7.3.280.0080.01216.34
7.3.270.0130.00717.40
7.3.260.0090.01016.56
7.3.250.0070.01116.44
7.3.240.0100.00916.47
7.3.230.0100.00716.43
7.3.210.0030.01316.49
7.3.200.0080.00816.46
7.3.190.0090.00916.39
7.3.180.0120.00416.54
7.3.170.0080.00816.55
7.3.160.0040.01916.71
7.2.330.0030.01416.81
7.2.320.0070.01416.86
7.2.310.0130.01016.88
7.2.300.0070.01016.72
7.2.290.0030.01316.53
7.2.60.0100.00317.11
7.1.200.0110.00015.47
7.1.70.0070.00017.15
7.1.60.0030.01019.47
7.1.00.0070.07322.45
7.0.200.0260.00914.75
7.0.60.0700.00019.98
7.0.50.0830.00020.48
7.0.40.1000.00020.39
7.0.30.0870.00020.47
7.0.20.0970.00020.27
7.0.10.0970.00020.34
7.0.00.0700.00020.44
5.6.280.0030.07320.86
5.6.210.0700.00020.74
5.6.200.0830.00021.04
5.6.190.0770.00021.07
5.6.180.0830.00021.02
5.6.170.1030.00021.21
5.6.160.0770.00021.18
5.6.150.1030.00021.02
5.6.140.1030.00021.13
5.6.130.0870.00021.21
5.6.120.0770.00021.02
5.6.110.0900.00021.07
5.6.100.0930.00021.17
5.6.90.0930.00021.05
5.6.80.0770.00020.45
5.6.70.0730.00020.56
5.6.60.0770.00020.43
5.6.50.0830.00020.55
5.6.40.0900.00020.37
5.6.30.0700.00020.57
5.6.20.0770.00020.48
5.6.10.0830.00020.56
5.6.00.0930.00020.36
5.5.350.0770.00020.38
5.5.340.0830.00020.86
5.5.330.0770.00020.87
5.5.320.0670.00020.77
5.5.310.1100.00020.85
5.5.300.1070.00020.79
5.5.290.1100.00020.95
5.5.280.0730.00020.87
5.5.270.0930.00020.84
5.5.260.0830.00020.83
5.5.250.0930.00020.64
5.5.240.0700.00020.41
5.5.230.1030.00020.38
5.5.220.1000.00020.21
5.5.210.1000.00020.25
5.5.200.0770.00020.18
5.5.190.0770.00020.31
5.5.180.0700.00020.23
5.5.160.0770.00020.22
5.5.150.0730.00020.20
5.5.140.0730.00020.19
5.5.130.0670.00020.14
5.5.120.0700.00020.18
5.5.110.0830.00020.21
5.5.100.0830.00020.12
5.5.90.0870.00020.19
5.5.80.1000.00020.29
5.5.70.0770.00020.07
5.5.60.0830.00020.10
5.5.50.0800.00020.09
5.5.40.0800.00020.10
5.5.30.0830.00019.99
5.5.20.0730.00020.09
5.5.10.0770.00020.16
5.5.00.0770.00020.20

preferences:
36.52 ms | 401 KiB | 5 Q