3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $aa = 1; } class B { public $objA; public function setA(A $objA) { $this->objA = $objA; } } $objA = new A; $objB = new B(); $objB->setA($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/eqRWp
function name:  (null)
number of ops:  17
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        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   19     6        INIT_METHOD_CALL                                         !1, 'setA'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   20     9        FETCH_OBJ_W                                      $9      !1, 'objA'
         10        ASSIGN_OBJ                                               $9, 'aa'
         11        OP_DATA                                                  666
   22    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function seta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eqRWp
function name:  setA
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 seta

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.29 ms | 1395 KiB | 15 Q