3v4l.org

run code in 300+ PHP versions simultaneously
<?php function g($name, array $vars) { return $name; } function f(&$v) { $v = 5; } $foo = null; $name = 'foo'; call_user_func_array('f', array(&${g($name, get_defined_vars())})); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OTAIi
function name:  (null)
number of ops:  18
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'
   13     2        INIT_FCALL                                               'f'
          3        INIT_FCALL                                               'g'
          4        SEND_VAR                                                 !1
          5        INIT_FCALL                                               'get_defined_vars'
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_FCALL                                      0  $5      
          9        FETCH_W                      local               $6      $5
         10        INIT_ARRAY                                       ~7      $6
         11        SEND_ARRAY                                               ~7
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      0          
   14    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OTAIi
function name:  g
number of ops:  4
compiled vars:  !0 = $name, !1 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2      > RETURN                                                   !0
    4     3*     > RETURN                                                   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/OTAIi
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:
151.48 ms | 1399 KiB | 19 Q