3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_multiupdate_from_keys(array &$array, array $keys, $value){ if(!empty($keys)){ $key = array_shift($keys); if(key_exists($key, $array)){ count($keys) > 0 ? array_multiupdate_from_keys($array[$key], $keys, $value) : $array[$key] = $value; } } } $array = array( 'a' => 'a', 'b' => 'b', 'c' => array( 0 => 0, 1 => 1, 2 => array( 'foo', 'bar' ) ) ); array_multiupdate_from_keys($array, array('c', 1, 0), 'updated'); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bIPKX
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   25     1        INIT_FCALL                                               'array_multiupdate_from_keys'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 'updated'
          5        DO_FCALL                                      0          
   27     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function array_multiupdate_from_keys:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 31
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 31
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 31
filename:       /in/bIPKX
function name:  array_multiupdate_from_keys
number of ops:  32
compiled vars:  !0 = $array, !1 = $keys, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        ISSET_ISEMPTY_CV                                 ~4      !1
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->31
    5     6    >   INIT_FCALL                                               'array_shift'
          7        SEND_REF                                                 !1
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !3, $6
    6    10        INIT_FCALL                                               'key_exists'
         11        SEND_VAR                                                 !3
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $8      
         14      > JMPZ                                                     $8, ->31
    7    15    >   COUNT                                            ~9      !1
         16        IS_SMALLER                                               0, ~9
         17      > JMPZ                                                     ~10, ->27
         18    >   INIT_FCALL_BY_NAME                                       'array_multiupdate_from_keys'
         19        CHECK_FUNC_ARG                                           
         20        FETCH_DIM_FUNC_ARG                               $11     !0, !3
         21        SEND_FUNC_ARG                                            $11
         22        SEND_VAR_EX                                              !1
         23        SEND_VAR_EX                                              !2
         24        DO_FCALL                                      0  $12     
         25        QM_ASSIGN                                        ~13     $12
         26      > JMP                                                      ->30
         27    >   ASSIGN_DIM                                       ~14     !0, !3
         28        OP_DATA                                                  !2
         29        QM_ASSIGN                                        ~13     ~14
         30    >   FREE                                                     ~13
   10    31    > > RETURN                                                   null

End of function array_multiupdate_from_keys

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.81 ms | 1403 KiB | 20 Q