3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { protected $profile; public function setProfile(Profile $profile) { $this->profile = $profile; } } class Profile { protected $user; public function __construct(User $user) { $this->user = $user; $user->setProfile($this); } } $user1 = new User(); $profile1 = new Profile($user1); $user2 = new User(); $profile2 = new Profile($user2); var_dump($profile1 == $profile2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PbATW
function name:  (null)
number of ops:  19
compiled vars:  !0 = $user1, !1 = $profile1, !2 = $user2, !3 = $profile2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $4      'User'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   27     3        NEW                                              $7      'Profile'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
   29     7        NEW                                              $10     'User'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $10
   30    10        NEW                                              $13     'Profile'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !3, $13
   32    14        INIT_FCALL                                               'var_dump'
         15        IS_EQUAL                                         ~16     !1, !3
         16        SEND_VAL                                                 ~16
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function setprofile

End of class User.

Class Profile:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PbATW
function name:  __construct
number of ops:  8
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        ASSIGN_OBJ                                               'user'
          2        OP_DATA                                                  !0
   21     3        INIT_METHOD_CALL                                         !0, 'setProfile'
          4        FETCH_THIS                                       $2      
          5        SEND_VAR_EX                                              $2
          6        DO_FCALL                                      0          
   22     7      > RETURN                                                   null

End of function __construct

End of class Profile.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.38 ms | 1388 KiB | 15 Q