3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testArray = array( 'router' => array( 'else' => 'xml' ), 'format' => 'fail', ); $path = 'router.format'; $result = $testArray; foreach(explode('.', $path) as $key) { if(isset($result[$key])) { $result = $result[$key]; } } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/HHuPC
function name:  (null)
number of ops:  19
compiled vars:  !0 = $testArray, !1 = $path, !2 = $result, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'router.format'
    6     2        ASSIGN                                                   !2, !0
    7     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '.'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $7      
          7      > FE_RESET_R                                       $8      $7, ->14
          8    > > FE_FETCH_R                                               $8, !3, ->14
    8     9    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, !3
         10      > JMPZ                                                     ~9, ->13
    9    11    >   FETCH_DIM_R                                      ~10     !2, !3
         12        ASSIGN                                                   !2, ~10
    7    13    > > JMP                                                      ->8
         14    >   FE_FREE                                                  $8
   12    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.35 ms | 1395 KiB | 17 Q