Re: Re: [RFC] Comparison and conversion inconsistency - need more info
| From: | Stas Malyshev | Date: | Sun, 10 Nov 2013 21:17:49 +0000 |
| Subject: | Re: Re: [RFC] Comparison and conversion inconsistency - need more info | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70093@lists.php.net to get a copy of this message | ||
Hi!
> TRUE always evaluated as 1. I guess I've checked this behavior and made
> wrong assumption
> FALSE/NULL is always evaluated as 0, but it's not.
True is not evaluated as 1, 1 is evaluated as true. When you compare
with bool, other side is converted to bool. Which is described in the
manual :) Try the same with -17, you'd get the same result, since -17 is
bool-eanized as true.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227