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, &$arg) { call_user_func_array(array('Testme', $func_name), $arg); } } $test = 2; Invoker::invoke('foo', $test); var_dump($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v0UMC
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 2
   15     1        INIT_STATIC_METHOD_CALL                                  'Invoker', 'invoke'
          2        SEND_VAL                                                 'foo'
          3        SEND_REF                                                 !0
          4        DO_FCALL                                      0          
   16     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Testme:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v0UMC
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/v0UMC
function name:  invoke
number of ops:  9
compiled vars:  !0 = $func_name, !1 = $arg
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:
151.76 ms | 1387 KiB | 15 Q