changing NULL behavior in PHP arithmetic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
#N/A * 6 = #N/A
#N/A / 6 = #N/A
6 / #N/A = #N/A

because arithmetic operations with "Unknown" operands should result to "Unknown" ...

TIA, Cor

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux