3v4l.org

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

Class Testme:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5TfOV
function name:  foo
number of ops:  3
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !0, 1
    5     2      > RETURN                                                   null

End of function foo

End of class Testme.

Class Invoker:
Function invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5TfOV
function name:  invoke
number of ops:  9
compiled vars:  !0 = $func_name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_ARRAY                                       ~2      'Testme'
          3        ADD_ARRAY_ELEMENT                                ~2      !0
          4        INIT_USER_CALL                                0          'call_user_func_array', ~2
          5        SEND_ARRAY                                               !1
          6        CHECK_UNDEF_ARGS                                         
          7        DO_FCALL                                      0          
   11     8      > RETURN                                                   null

End of function invoke

End of class Invoker.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.5 ms | 1396 KiB | 15 Q