Re: Nesting level too deep - recursive dependency?

From: Date: Mon, 18 Oct 2004 18:04:48 +0000
Subject: Re: Nesting level too deep - recursive dependency?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-199751@lists.php.net to get a copy of this message
Brent Baisley wrote:
I was looking at this before and I'm not even sure what you are trying to do. For one, you are testing to see if the contents of a class variable are equal to a class instance: $TestObj->myself == $TestObj Which seems a logic equivalent to: $TestObj->myself == TestClass() ???
No, it isn't, or at least it shouldn't. $TestObj and $TestObj->myself are *both* instances of TestClass.
And in your class you are setting a class variable equal to the class it is in: $this->myself = $this The recursion may actually be occurring in the $this->myself = $this line, but PHP isn't throwing an error until the comparison line.
I don't know PHP internals, so you may be right.
Perhaps the comments posted in this link will help, it seems to explain the exact symptom you are getting: http://php.planetmirror.com/manual/en/language.oop.object-comparison.php
This looks really interesting. Thanks a lot.

« previous php.general (#199751) next »