3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function f(&$ref1, &$ref2) { $ref1 = 'foo'; $ref2 = 'bar'; } } class b { public function __call($methodName, $arguments) { $a = new a(); call_user_func_array(array( $a, $methodName //->$methodName( $arguments[0][0], $arguments[0][1]); ), $arguments[0]); } } $ref1 = 'X'; $ref2 = 'Y'; $b = new b(); $b->f( array( &$ref1, &$ref2)); var_dump($ref1, $ref2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5BFjM
function name:  (null)
number of ops:  15
compiled vars:  !0 = $ref1, !1 = $ref2, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN                                                   !0, 'X'
   22     1        ASSIGN                                                   !1, 'Y'
   23     2        NEW                                              $5      'b'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $5
   24     5        INIT_METHOD_CALL                                         !2, 'f'
          6        INIT_ARRAY                                       ~8      !0
          7        ADD_ARRAY_ELEMENT                                ~8      !1
          8        SEND_VAL_EX                                              ~8
          9        DO_FCALL                                      0          
   25    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function f

End of class a.

Class b:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5BFjM
function name:  __call
number of ops:  13
compiled vars:  !0 = $methodName, !1 = $arguments, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        NEW                                              $3      'a'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $3
   17     5        INIT_ARRAY                                       ~6      !2
          6        ADD_ARRAY_ELEMENT                                ~6      !0
          7        INIT_USER_CALL                                0          'call_user_func_array', ~6
   18     8        FETCH_DIM_R                                      ~7      !1, 0
          9        SEND_ARRAY                                               ~7
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0          
   19    12      > RETURN                                                   null

End of function __call

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.94 ms | 1396 KiB | 15 Q