3v4l.org

run code in 300+ PHP versions simultaneously
<?php function traverseArray(array $a, array $keys) { $tmp = $a; foreach ($keys as $key) { if (!isset($tmp[$key])) { return null; } $tmp = $tmp[$key]; } return $tmp; } var_dump(traverseArray(array('a' => array('b' => array('c' => array('d' => 5)))), array('a', 'b', 'c', 'd')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B1VZN
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'traversearray'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 <array>
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function traversearray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/B1VZN
function name:  traverseArray
number of ops:  16
compiled vars:  !0 = $a, !1 = $keys, !2 = $tmp, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        ASSIGN                                                   !2, !0
    4     3      > FE_RESET_R                                       $5      !1, ->13
          4    > > FE_FETCH_R                                               $5, !3, ->13
    5     5    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !2, !3
          6        BOOL_NOT                                         ~7      ~6
          7      > JMPZ                                                     ~7, ->10
    6     8    >   FE_FREE                                                  $5
          9      > RETURN                                                   null
    8    10    >   FETCH_DIM_R                                      ~8      !2, !3
         11        ASSIGN                                                   !2, ~8
    4    12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $5
   10    14      > RETURN                                                   !2
   11    15*     > RETURN                                                   null

End of function traversearray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.48 ms | 1399 KiB | 16 Q