3v4l.org

run code in 300+ PHP versions simultaneously
<?php function recursiveSet(&$array, $arg, $value){ if(empty($arg)){ $array = $value; return $array; } $key = array_shift($arg); $array[$key] = array(); return recursiveSet($array[$key],$arg); } $arra = array(); $arg = array('adfas','adfasdf','adsfadfa'); $stuff = recursiveSet($arra,$arg); print_r($arra);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Dote
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arra, !1 = $arg, !2 = $stuff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   13     2        INIT_FCALL                                               'recursiveset'
          3        SEND_REF                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   14     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function recursiveset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Dote
function name:  recursiveSet
number of ops:  21
compiled vars:  !0 = $array, !1 = $arg, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        ISSET_ISEMPTY_CV                                         !1
          4      > JMPZ                                                     ~4, ->7
    4     5    >   ASSIGN                                                   !0, !2
    5     6      > RETURN                                                   !0
    7     7    >   INIT_FCALL                                               'array_shift'
          8        SEND_REF                                                 !1
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !3, $6
    8    11        ASSIGN_DIM                                               !0, !3
         12        OP_DATA                                                  <array>
    9    13        INIT_FCALL_BY_NAME                                       'recursiveSet'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_DIM_FUNC_ARG                               $9      !0, !3
         16        SEND_FUNC_ARG                                            $9
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0  $10     
         19      > RETURN                                                   $10
   10    20*     > RETURN                                                   null

End of function recursiveset

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.33 ms | 1399 KiB | 18 Q