From: Ashley Sheridan
To: cr.vege...@gmail.com
Cc: php-general@lists.php.net
Sent: Thursday, April 15, 2010 10:08 AM
Subject: Re: [PHP] changing NULL behavior in PHP arithmetic
On Thu, 2010-04-15 at 09:46 +0200, cr.vege...@gmail.com wrote:
Hi All,
Is there an option in PHP to
>> 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 (
On Thu, 2010-04-15 at 09:46 +0200, cr.vege...@gmail.com wrote:
> Hi All,
>
> Is there an option in PHP to change the behavior of NULL in PHP functions ?
> Now PHP uses NULL as a 0 (zero) for arithmetic, for example:
> NULL + 6 = 6
> NULL * 6 = 0
> NULL / 6 = 0
> 6 / NULL = Division by zero
>
> W
Hi All,
Is there an option in PHP to change the behavior of NULL in PHP functions ?
Now PHP uses NULL as a 0 (zero) for arithmetic, for example:
NULL + 6 = 6
NULL * 6 = 0
NULL / 6 = 0
6 / NULL = Division by zero
What I need is the same behavior as #N/A (or =NA()) in Excel, where:
#N/A + 6 = #N/A
4 matches
Mail list logo