3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = []; $f['Kitchen']['Dishes']['Mantovarka']=3; $f['Kitchen']['Dishes']['Castrool']=91; $f['Kitchen']['Dishes']['Separator']=10; $f['Kitchen']['Product']=18; $f['Kitchen']['Textile']=19; $f['Kitchen']['Blue things One2']['Juicemaker']=25; $f['Kitchen']['Blue things One']['Freegener']=13; $f['Kitchen']['Blue things']['Microwave']=4; $f['Kitchen']['Blue things']['Iron']=24; function findKeyPath($arr, $key, $path = '') { foreach($arr as $k => $value) { if(is_array($arr[$k])) { $ret = findKeyPath($arr[$k], $key, $path.$k.','); if(is_array($ret)) { return $ret; } }else if($k == $key) { return explode(',', $path.$key); } } return null; } print_r(findKeyPath($f, 'Juicemaker'));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Kitchen [1] => Blue things One2 [2] => Juicemaker )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
102.34 ms | 405 KiB | 5 Q