3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { function &call_user_func_array_userland($callable, array $args) { return $callable(...$args); } } namespace Bar { $foo = 'foo'; $bar = &call_user_func_array_userland(function &() use (&$foo) { return $foo; }, []); $bar = 'bar'; echo $foo . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D0Chh
function name:  (null)
number of ops:  13
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'foo'
   15     1        INIT_NS_FCALL_BY_NAME                                    'Bar%5Ccall_user_func_array_userland'
          2        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          3        BIND_LEXICAL                                             ~3, !0
   17     4        SEND_VAL_EX                                              ~3
          5        SEND_VAL_EX                                              <array>
   15     6        DO_FCALL                                      0  $4      
   17     7        ASSIGN_REF                                               !1, $4
   19     8        ASSIGN                                                   !1, 'bar'
   21     9        FETCH_CONSTANT                                   ~7      'Bar%5CPHP_EOL'
         10        CONCAT                                           ~8      !0, ~7
         11        ECHO                                                     ~8
   23    12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/D0Chh
function name:  Bar\{closure}
number of ops:  3
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   BIND_STATIC                                              !0
   16     1      > RETURN_BY_REF                                            !0
   17     2*     > RETURN_BY_REF                                            null

End of Dynamic Function 0

Function call_user_func_array_userland:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/D0Chh
function name:  call_user_func_array_userland
number of ops:  8
compiled vars:  !0 = $callable, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_UNPACK                                              !1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1  $2      
          6      > RETURN_BY_REF                                            $2
    7     7*     > RETURN_BY_REF                                            null

End of function call_user_func_array_userland

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.96 ms | 999 KiB | 14 Q