3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a['abc']['def']['ghi'] = 'meukee!'; function getArrayValueByKeys(array $array, $key, ...$keys) { if (isset($array[$key])) return getArrayValueByKeys($array[$key], ...$keys); throw new Exception; } echo getArrayValueByKeys($a, ...['abc', 'def', 'ghi']); echo getArrayValueByKeys($a, ...['ddd', 'def', 'ghi']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gh8Zo
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_DIM_W                                      $1      !0, 'abc'
          1        FETCH_DIM_W                                      $2      $1, 'def'
          2        ASSIGN_DIM                                               $2, 'ghi'
          3        OP_DATA                                                  'meukee%21'
   14     4        INIT_FCALL                                               'getarrayvaluebykeys'
          5        SEND_VAR                                                 !0
          6        SEND_UNPACK                                              <array>
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      1  $4      
          9        ECHO                                                     $4
   16    10        INIT_FCALL                                               'getarrayvaluebykeys'
         11        SEND_VAR                                                 !0
         12        SEND_UNPACK                                              <array>
         13        CHECK_UNDEF_ARGS                                         
         14        DO_FCALL                                      1  $5      
         15        ECHO                                                     $5
         16      > RETURN                                                   1

Function getarrayvaluebykeys:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/gh8Zo
function name:  getArrayValueByKeys
number of ops:  17
compiled vars:  !0 = $array, !1 = $key, !2 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_VARIADIC                                    !2      
    7     3        ISSET_ISEMPTY_DIM_OBJ                         0          !0, !1
          4      > JMPZ                                                     ~3, ->13
    8     5    >   INIT_FCALL_BY_NAME                                       'getArrayValueByKeys'
          6        CHECK_FUNC_ARG                                           
          7        FETCH_DIM_FUNC_ARG                               $4      !0, !1
          8        SEND_FUNC_ARG                                            $4
          9        SEND_UNPACK                                              !2
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      1  $5      
         12      > RETURN                                                   $5
   10    13    >   NEW                                              $6      'Exception'
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $6
   11    16*     > RETURN                                                   null

End of function getarrayvaluebykeys

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.96 ms | 1403 KiB | 15 Q