3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3,[1,2,3,4,[1,2,3,4,5]]]; function recursivelyCreateObjs(array $array) { $obj = new stdClass; foreach($obj as $key => $value) { if(is_array($value)) { $obj->$key = recursivelyCreateObjs($value); } else { $obj->$key = $value; } } return $obj; } var_dump(recursivelyCreateObjs($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AdUVU
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'recursivelycreateobjs'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function recursivelycreateobjs:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/AdUVU
function name:  recursivelyCreateObjs
number of ops:  21
compiled vars:  !0 = $array, !1 = $obj, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        NEW                                              $4      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    7     4      > FE_RESET_R                                       $7      !1, ->18
          5    > > FE_FETCH_R                                       ~8      $7, !2, ->18
          6    >   ASSIGN                                                   !3, ~8
    8     7        TYPE_CHECK                                  128          !2
          8      > JMPZ                                                     ~10, ->15
    9     9    >   INIT_FCALL_BY_NAME                                       'recursivelyCreateObjs'
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0  $12     
         12        ASSIGN_OBJ                                               !1, !3
         13        OP_DATA                                                  $12
         14      > JMP                                                      ->17
   12    15    >   ASSIGN_OBJ                                               !1, !3
         16        OP_DATA                                                  !2
    7    17    > > JMP                                                      ->5
         18    >   FE_FREE                                                  $7
   15    19      > RETURN                                                   !1
   16    20*     > RETURN                                                   null

End of function recursivelycreateobjs

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.98 ms | 1399 KiB | 16 Q