Re: Comparison Oddity
| From: | php3 at developersdesk dot com | Date: | Thu, 30 Nov 2000 13:25:40 +0000 |
| Subject: | Re: Comparison Oddity | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28017@lists.php.net to get a copy of this message | ||
Addressed to: Paul Mullen <pem@nellump.com>
php-general@lists.php.net
** Reply to note from Paul Mullen <pem@nellump.com> Thu, 30 Nov 00 02:59:35 -0800
>
> Given the two following expressions:
>
> A) ( $column == "date" ) B) ( $column === "date" )
>
> When $column is set to '0' (integer zero), why would expression A
> evaluate to true, and B evaluate to false?
== Compare values
=== Compare values and types
The numeric value of 'date' is 0, but the type is string; which does not
match the numeric type of 0.
Are you sure you set $column to '0', and not to 0? When I tried it:
0 == $column : true
'0' == $column : false
0 === $column : false
'0' === $column : false
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com