3v4l.org

run code in 300+ PHP versions simultaneously
<?php class one { public $test = 1; } class two { public $test = 0; public function __construct(one $one) { $this->test =& $one->test; } } $one = new one; $two = new two($one); $one->test = 5; var_dump($two->test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41OuT
function name:  (null)
number of ops:  14
compiled vars:  !0 = $one, !1 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'one'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        NEW                                              $5      'two'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   22     7        ASSIGN_OBJ                                               !0, 'test'
          8        OP_DATA                                                  5
   24     9        INIT_FCALL                                               'var_dump'
         10        FETCH_OBJ_R                                      ~9      !1, 'test'
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class one: [no user functions]
Class two:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41OuT
function name:  __construct
number of ops:  6
compiled vars:  !0 = $one
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_OBJ_W                                      $2      !0, 'test'
          2        MAKE_REF                                         $3      $2
          3        ASSIGN_OBJ_REF                                           'test'
          4        OP_DATA                                                  $3
   15     5      > RETURN                                                   null

End of function __construct

End of class two.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.78 ms | 1399 KiB | 15 Q