3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oam5j
function name:  (null)
number of ops:  13
compiled vars:  !0 = $somearray, !1 = $map, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, 'item1%2Fsubitem3%2Fsubsubitem'
   18     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '%2F'
          4        SEND_VAL                                                 '%27%5D%5B%27'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      '%24result+%3D+%24somearray%5B%27', $5
          8        CONCAT                                           ~7      ~6, '%27%5D'
          9        CONCAT                                           ~8      ~7, '%3B'
         10        INCLUDE_OR_EVAL                                          ~8, EVAL
   20    11        ECHO                                                     !2
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.75 ms | 1394 KiB | 15 Q