Re: [PHP4BETA] compare error
| From: | Zeev Suraski | Date: | Wed, 09 Feb 2000 21:35:02 +0000 |
| Subject: | Re: [PHP4BETA] compare error | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-9997@lists.php.net to get a copy of this message | ||
Comparing a string to a number results in a numeric comparison. Any string that does not have a number format (e.g. "foo", or "record", but not "1002") has the numeric value of 0. So, 'record'==0 is true.
Zeev
At 19:50 09/02/2000 , Vadim Tkachenko wrote:
I have simple script <? if (0!="record") {echo "0!='record'";} else {echo "0=='record'";} // 0=='record' ?> in result "0=='record'" same effect in PHP3-- Zeev Suraski <zeev@zend.com> http://www.zend.com/