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; $tow = 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/TNJDv
function name:  (null)
number of ops:  14
compiled vars:  !0 = $one, !1 = $tow, !2 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $3      'one'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   20     3        NEW                                              $6      'two'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
   22     7        ASSIGN_OBJ                                               !0, 'test'
          8        OP_DATA                                                  5
   24     9        INIT_FCALL                                               'var_dump'
         10        FETCH_OBJ_R                                      ~10     !2, 'test'
         11        SEND_VAL                                                 ~10
         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/TNJDv
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:
148.33 ms | 1395 KiB | 15 Q