3v4l.org

run code in 300+ PHP versions simultaneously
<?php function setByLink( &$tree, &$dst ) { $dst = &$tree[0]; $tree[] = 'Hi'; } $tree = [ [ 1, 2 ], 3 ]; setByLink( $tree, $arr ); $arr[] = 'Hello'; var_dump( $tree );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/skast
function name:  (null)
number of ops:  11
compiled vars:  !0 = $tree, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'setbylink'
          2        SEND_REF                                                 !0
          3        SEND_REF                                                 !1
          4        DO_FCALL                                      0          
   17     5        ASSIGN_DIM                                               !1
          6        OP_DATA                                                  'Hello'
   18     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function setbylink

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.59 ms | 1397 KiB | 16 Q