- var_dump: documentation ( source)
<?php
class User
{
public $profile;
}
class Profile
{
public function __construct(User $user)
{
$this->user = $user;
$user->profile = $this;
}
}
$user1 = new User;
$prof1 = new Profile($user1);
$user2 = new User;
$prof2 = new Profile($user2);
var_dump($prof1 == $prof2);