3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function unsetMultidimensional(&$array, $keys) { $key = array_shift($keys); if(isset($array[$key])) { if(count($keys) === 0) { //Logger::info('Key is successfully removed'); unset($array[$key]); } else if(is_array($array[$key])) { unsetMultidimensional($array[$key], $keys); } else { //Logger::error('Key doesn\'t exist'): $array = false; } } } var_dump(unsetMultidimensional(array( 'foo' => 'bar' ), explode('/', 'foo')));
based on is8Ob
Output for 4.3.2 - 5.4.35
Fatal error: Only variables can be passed by reference in /in/LuLmc on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Only variables can be passed by reference in /in/LuLmc on line 20