3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['a' => 1, 'b' => ['c' => 3]]; function recursivelyCreateObjs(array $array) { $obj = new stdClass; foreach($array 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
Jump found. Position 1 = -2
filename:       /in/02FJF
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>
   5     1        NOP                                                      
  18     2        INIT_FCALL                                               'var_dump'
         3        INIT_FCALL                                               'recursivelycreateobjs'
         4        SEND_VAR                                                 !0
         5        DO_FCALL                                      0  $2      
         6        SEND_VAR                                                 $2
         7        DO_ICALL                                                 
         8      > RETURN                                                   1

Function recursivelycreateobjs:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
Jump found. Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
Jump found. Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
Jump found. Position 1 = 17
Branch analysis from position: 17
Jump found. Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
Jump found. Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 18
Jump found. Position 1 = -2
Branch analysis from position: 18
filename:       /in/02FJF
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      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !1, $4
   7     4      > FE_RESET_R                                       $7      !0, ->18
         5    > > FE_FETCH_R                                               $7, !2, ->18
         6    >   ASSIGN                                                   !3, ~8
   8     7        TYPE_CHECK                                    7  ~10     !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
        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 7.3.0