Antony Dovgal wrote: > On 06.06.2007 11:08, [EMAIL PROTECTED] wrote: >>> Why? >>> The behavior is quite clear - if the objects are instances of the >>> same class, we have no other way to compare them but to compare their >>> properties, this also applies to properties' properties and >>> properties' properties' properties etc. >> Well yes but in this case they are the same instance. Comparing the >> properties is then useless since they will always be the same. >> >> Well there could be made a check to see if the objects are the same >> instance (like with ===) before actually checking the properties. > > Hm.. I was actually a bit surprised to see that we don't do "===" before > doing "==" on objects. > That would of course prevent the recursion in case of comparing an > object to itself. > > I committed a patch minute ago, but it obviously won't change the case > when the objects are different and contain circular references. > Anyway, thanks a lot for pointing this out.
This is especially surprising because I mentioned this in Oct. 2004 (http://groups.google.com/group/mailing.www.php-dev/msg/c3bcb36e5c6eb07b?dmode=source&hl=en) and Andi took this on: http://groups.google.com/group/mailing.www.php-dev/msg/4429a975af7e4924?dmode=source&hl=en then claimed to have fixed it: http://groups.google.com/group/mailing.www.php-dev/msg/6ad9e1b23bf4862e?dmode=source&hl=en However, a scan of all CVS commits between Oct. 19-21 at news.php.net (this took a while) revealed no commits at all, and looking at zend_operators.c in both Zend/ and ZendEngine2 reveals no commits by Andi anywhere near this time. Sounds like it just slipped through the cracks somehow. Greg -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php