3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class A { public function __call($method, $args){ $test = &$args[0]; call_user_func_array([$this, 'test'], $args); } protected function test(&$data) { $data = "done"; } } $data = 42; $a = new A(); $a->test($data); var_dump($data); die();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/bqO40
function name:  (null)
number of ops:  12
compiled vars:  !0 = $data, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 42
   20     1        NEW                                              $3      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   21     4        INIT_METHOD_CALL                                         !1, 'test'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   23     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   24    10      > EXIT                                                     
         11*     > RETURN                                                   1

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

End of function __call

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bqO40
function name:  test
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        ASSIGN                                                   !0, 'done'
   15     2      > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.25 ms | 1396 KiB | 15 Q