Elliotte Harold wrote:
Michael Southwell wrote:

ah, no, these answers are exactly right, given that $a is an integer, $b and $c are strings, and $d is unset. $b and $c when converted to integers for the purpose of comparison in #1 and #3 turn into 0 (zero) so the comparisons are true. #2 compares two different strings and so is false. #4 compares 0 to the integer of unset and so is true. #5 and #6 compare strings to the string of unset and so are false.



Yes, this is what PHP does. It's just that what PHP does is insane. It does not match any normal, logical thought process.

Insane may be overly harsh -- how about 'unorthodox'?

It does strike me, though, that there are an awfully large
number of questions to the internals list asking whether a
certain behavior is expected or not.

--

T. Gales & Associates
'Helping People Connect with Technology'

http://www.tgaconnect.com
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to