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($a = &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/ftjlX
function name:  (null)
number of ops:  16
compiled vars:  !0 = $foo, !1 = $name, !2 = $a
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               $5      !1
          5        SEND_REF                                                 $5
          6        DO_FCALL                                      0  $6      
          7        ASSIGN_REF                                       $7      !2, $6
          8        INIT_ARRAY                                       ~8      $7
          9        SEND_ARRAY                                               ~8
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0          
   14    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function g:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/ftjlX
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/ftjlX
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:
159.22 ms | 1398 KiB | 17 Q