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); } } $ref1 = 'X'; $ref2 = 'Y'; $b = new b(); $b->f( $ref1, $ref2); var_dump($ref1, $ref2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3au0
function name:  (null)
number of ops:  14
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        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   25     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class a:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3au0
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/M3au0
function name:  __call
number of ops:  12
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        SEND_ARRAY                                               !1
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      0          
   19    11      > RETURN                                                   null

End of function __call

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.04 ms | 1396 KiB | 15 Q