3v4l.org

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

Function g:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/5GCiU
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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.52 ms | 1397 KiB | 17 Q