At 10:10 AM 10/19/2004 -0400, Greg Beaver wrote:
Jevon Wright wrote:
I first stumbled upon this problem in one of the RCs for PHP 5, but at the
time I thought I was at fault...
Consider the documentation at
http://www.php.net/manual/en/language.oop5.object-comparison.php : the
documentation is a little vague, but it does say "Two object instances are
equal if they have the same attributes and values, and are instances of the
same class." Thus explaining the recursive loop...
Maybe write a big flashing note in the documentation instead about this
trap?

Better, if two values satisfy ===, they are clearly ==. I would imagine it would not be expensive to simply do a === check before doing the == check in the engine?

That might actually be a good idea. It would definitely solve some headaches and be faster.
Does anyone object to me doing this?


Andi

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to