3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(); $obj = new stdClass(); function foo( $foo ) { $foo[0]['key'] = 'value'; $foo[1]->key = 'value'; } foo( array( &$array, $obj ) ); var_dump( $array ); var_dump( $obj );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TKgIf
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        NEW                                              $3      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   11     4        INIT_FCALL                                               'foo'
          5        INIT_ARRAY                                       ~6      !0
          6        ADD_ARRAY_ELEMENT                                ~6      !1
          7        SEND_VAL                                                 ~6
          8        DO_FCALL                                      0          
   13     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   14    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TKgIf
function name:  foo
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_DIM_W                                      $1      !0, 0
          2        ASSIGN_DIM                                               $1, 'key'
          3        OP_DATA                                                  'value'
    8     4        FETCH_DIM_W                                      $3      !0, 1
          5        ASSIGN_OBJ                                               $3, 'key'
          6        OP_DATA                                                  'value'
    9     7      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.72 ms | 1439 KiB | 15 Q