3v4l.org

run code in 300+ PHP versions simultaneously
<?php class r { protected $a = null; public function __construct($a){$this->a = $a;} public function add(){$this->a++;} public function getVal(){return $this->a;} } class a { private function test($ref) { $ref->add(); } public function __call($f, $a) { call_user_func_array(array($this, $f), $a); } } $x = new r(10); $a = new a(); $a->test($x); echo $x->getVal();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6XW
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'r'
          1        SEND_VAL_EX                                              10
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   25     4        NEW                                              $5      'a'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   26     7        INIT_METHOD_CALL                                         !1, 'test'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   27    10        INIT_METHOD_CALL                                         !0, 'getVal'
         11        DO_FCALL                                      0  $9      
         12        ECHO                                                     $9
         13      > RETURN                                                   1

Class r:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6XW
function name:  __construct
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'a'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function __construct

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6XW
function name:  add
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   PRE_INC_OBJ                                              'a'
          1      > RETURN                                                   null

End of function add

Function getval:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6XW
function name:  getVal
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getval

End of class r.

Class a:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR6XW
function name:  test
number of ops:  4
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        INIT_METHOD_CALL                                         !0, 'add'
          2        DO_FCALL                                      0          
   16     3      > RETURN                                                   null

End of function test

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

End of function __call

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.52 ms | 1399 KiB | 13 Q