3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_key_exists_recursive($key, array $array, $strict = false) { foreach ($array as $k => $v) { if ($strict && $key === $k) { return true; } else if (!$strict && $key == $k) { return true; } else if (is_array($v)) { return array_key_exists_recursive($key, $v, $strict); } } } $array = Array ( 21 => Array ( ) 24 => Array ( 22 => Array ( ) 25 => Array ( 26 => Array ( ) ) ) ); var_dump(array_key_exists_recursive(22, $array));
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '24' (T_LNUMBER), expecting ')' in /in/opsrp on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_LNUMBER, expecting ')' in /in/opsrp on line 16
Process exited with code 255.

preferences:
180.21 ms | 1394 KiB | 57 Q