3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &g(&$v) { $b = &$v; return $b; } function f(&$v) { $v = 5; } $foo = null; $name = 'foo'; //call_user_func_array('f', array($a = &g($$name))); $a = g($$name); $a = 3; //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/YGgnR
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo, !1 = $name, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, null
   12     1        ASSIGN                                                   !1, 'foo'
   14     2        INIT_FCALL                                               'g'
          3        FETCH_W                      local               $5      !1
          4        SEND_REF                                                 $5
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !2, $6
   15     7        ASSIGN                                                   !2, 3
   17     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function g:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/YGgnR
function name:  g
number of ops:  4
compiled vars:  !0 = $v, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN_REF                                               !1, !0
    4     2      > RETURN_BY_REF                                            !1
    5     3*     > 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/YGgnR
function name:  f
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN                                                   !0, 5
    9     2      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.44 ms | 1389 KiB | 16 Q