|
-
Jan 24th, 2007, 12:46 PM
#2
Re: is there something I don't understand so that 'none' == 1
It seems that for the purpose of comparison, PHP converts both terms to boolean. Integers != 0 convert to true and strings != "" convert to true, so the terms are equivalent.
To force PHP to not convert anything (in which case different types always compare false), use === instead of ==.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|