3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array( 'a' => '', 'b' => '', 'c' => array( 'd' => '', 'e' => '', 'f' => array( 'g' => '', 'h' => '', 'i' => '', ), ), ); echo (_array_key_exists_r($array, 'a')) ? 'aye' : 'nah'; function _array_key_exists_r($array, $key) { foreach ($array as $index => $subarray) { if ($index == $key) return TRUE; elseif (is_array($subarray)) return _array_key_exists_r($subarray, $key); } return FALSE; }
Output for 4.3.0 - 7.2.0
aye