3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'router.format'; $array = array( 'router' => array( 'format' => 'xml', ), ); $string = explode('.', $string); $result = $array; for($i = 0; $i < count($string); ++$i) { $key = $string[$i]; if(isset($result[$key])) $result = $result[$key]; else break; } print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 10
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 10
Branch analysis from position: 22
Branch analysis from position: 10
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
filename:       /in/nOWRX
function name:  (null)
number of ops:  26
compiled vars:  !0 = $string, !1 = $array, !2 = $result, !3 = $i, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'router.format'
    4     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '.'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !0, $7
   11     7        ASSIGN                                                   !2, !1
   13     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->19
   15    10    >   FETCH_DIM_R                                      ~11     !0, !3
         11        ASSIGN                                                   !4, ~11
   16    12        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !4
         13      > JMPZ                                                     ~13, ->17
   17    14    >   FETCH_DIM_R                                      ~14     !2, !4
         15        ASSIGN                                                   !2, ~14
         16      > JMP                                                      ->18
   19    17    > > JMP                                                      ->22
   13    18    >   PRE_INC                                                  !3
         19    >   COUNT                                            ~17     !0
         20        IS_SMALLER                                               !3, ~17
         21      > JMPNZ                                                    ~18, ->10
   22    22    >   INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.04 ms | 1396 KiB | 17 Q