3v4l.org

run code in 500+ PHP versions simultaneously
<?php function do_action_ref_array( $callback, $args ) { var_dump($args); //$args[0] = 'b'; call_user_func_array( $callback, array_slice( $args, 0, 2 ) ); } function filter( $arg1, &$arg2 ) { var_dump( $arg1, $arg2 ); return $arg1; }; class Test { public function run() { do_action_ref_array( 'filter', [1, &$this] ); } } $object = new Test(); $object->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DCCeh
function name:  (null)
number of ops:  6
compiled vars:  !0 = $object
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $1      'Test'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   21     3        INIT_METHOD_CALL                                             !0, 'run'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

Function do_action_ref_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DCCeh
function name:  do_action_ref_array
number of ops:  9
compiled vars:  !0 = $callback, !1 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    4     2        INIT_FCALL                                                   'var_dump'
          3        SEND_VAR                                                     !1
          4        DO_ICALL                                                     
    6     5        INIT_USER_CALL                                    0          'call_user_func_array', !0
          6        SEND_ARRAY                                                   !1, 2
          7        DO_FCALL                                          0          
    7     8      > RETURN                                                       null

End of function do_action_ref_array

Function filter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DCCeh
function name:  filter
number of ops:  8
compiled vars:  !0 = $arg1, !1 = $arg2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   10     2        INIT_FCALL                                                   'var_dump'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        DO_ICALL                                                     
   11     6      > RETURN                                                       !0
   12     7*     > RETURN                                                       null

End of function filter

Class Test:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DCCeh
function name:  run
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                                   'do_action_ref_array'
          1        SEND_VAL                                                     'filter'
          2        INIT_ARRAY                                           ~0      1
          3        FETCH_THIS                                           $1      
          4        ADD_ARRAY_ELEMENT                                    ~0      $1
          5        SEND_VAL                                                     ~0
          6        DO_FCALL                                          0          
   17     7      > RETURN                                                       null

End of function run

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
222.58 ms | 2128 KiB | 15 Q