3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $aa = 1; } class B { public $objA; public function __construct(A $objA) { $this->objA = $objA; } } $objA = new A; $objB = new B($objA); $objB->objA->aa = 666; var_dump($objA, $objB);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TLjCk
function name:  (null)
number of ops:  15
compiled vars:  !0 = $objA, !1 = $objB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        NEW                                              $5      'B'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   19     7        FETCH_OBJ_W                                      $8      !1, 'objA'
          8        ASSIGN_OBJ                                               $8, 'aa'
          9        OP_DATA                                                  666
   21    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TLjCk
function name:  __construct
number of ops:  4
compiled vars:  !0 = $objA
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'objA'
          2        OP_DATA                                                  !0
   13     3      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.59 ms | 1395 KiB | 15 Q