3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'key' => [ 'key_2' => [ 'key_3' => 'Value 3' ] ], ]; function get_value($array, $key ) { $keys = explode(",", $key); Foreach($keys as $k){ $array = $array[$k]; } Return $array; } Var_dump(get_value($array, 'key,key_2,key_3' ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mnvOs
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   19     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'get_value'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'key%2Ckey_2%2Ckey_3'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function get_value:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/mnvOs
function name:  get_value
number of ops:  15
compiled vars:  !0 = $array, !1 = $key, !2 = $keys, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !2, $4
   13     7      > FE_RESET_R                                       $6      !2, ->12
          8    > > FE_FETCH_R                                               $6, !3, ->12
   14     9    >   FETCH_DIM_R                                      ~7      !0, !3
         10        ASSIGN                                                   !0, ~7
   13    11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $6
   16    13      > RETURN                                                   !0
   17    14*     > RETURN                                                   null

End of function get_value

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.57 ms | 1015 KiB | 16 Q