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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php