Re: changing NULL behavior in PHP arithmetic
| From: | kranthi | Date: | Thu, 15 Apr 2010 08:47:16 +0000 |
| Subject: | Re: changing NULL behavior in PHP arithmetic | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-304108@lists.php.net to get a copy of this message | ||
>> because arithmetic operations with "Unknown" operands should result to
>> "Unknown" ...
in PHP "Unknown" values are represented by NaN, not NULL
http://php.net/manual/en/function.is-nan.php
but what surprises me is
is_nan(6/0) = (bool)false (along with a warning)
>> Now PHP uses NULL as a 0 (zero) for arithmetic
I dont expect anything different, because intval(null) is 0.