3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $somearray = array( 'item1' => array( 'subitem1' => 'Some value', 'subitem2' => 'Some other value', 'subitem3' => array( 'subsubitem' => 'A sub value' ) ), 'item2' => 'a different value' ); $map = "item1/subitem3/subsubitem"; eval('$result = $somearray' . "['" . str_replace("/","']['",$map) . "']" . ';'); echo $result;
Output for 4.3.0 - 7.2.0
A sub value