<?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(get_object_vars($profile1) == get_object_vars($profile2));
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/4XWI4 on line 6
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/4XWI4 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/4XWI4 on line 6
Process exited with code 255.