<?php
class User
{
public $profile;
}
class Profile
{
public $user;
public function __construct(User $user)
{
$this->user = $user;
$user->profile = $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));
Fatal error: Nesting level too deep - recursive dependency? in /in/TT7lf on line 27
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/TT7lf 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/TT7lf 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/TT7lf on line 6
Process exited with code 255.