3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function traverseArray(array $a, array $keys) { $tmp = $a; foreach ($keys as $key) { if (!isset($tmp[$key])) { return null; } $tmp = $tmp[$key]; } return $tmp; } var_dump(traverseArray(array('a' => array('b' => array('c' => array('d' => 5)))), array('a', 'b', 'c', 'd')));
Output for 5.2.14 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
int(5)
Output for hhvm-3.10.0

Process exited with code 153.