3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &g(&$v) { return $v; } function f(&$v) { $v = 5; } $foo = null; $name = 'foo'; call_user_func_array('f', array(g($$name))); //var_dump(array(g($$name))); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c8fH7
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, null
   11     1        ASSIGN                                                   !1, 'foo'
   12     2        INIT_FCALL                                               'f'
          3        INIT_FCALL                                               'g'
          4        FETCH_W                      local               $4      !1
          5        SEND_REF                                                 $4
          6        DO_FCALL                                      0  $5      
          7        INIT_ARRAY                                       ~6      $5
          8        SEND_ARRAY                                               ~6
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      0          
   14    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function g:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/c8fH7
function name:  g
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1      > RETURN_BY_REF                                            !0
    4     2*     > RETURN_BY_REF                                            null

End of function g

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c8fH7
function name:  f
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !0, 5
    8     2      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.41 ms | 1389 KiB | 17 Q