[Question] behavior of `null + null = 0`

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

 



Dear PHP users.

I have questions about the behavior `null + null = 0`.

Since PHP4.3.0, `null + null` becomes `0`.
https://3v4l.org/YX3Od#veol

Form php-src, 
https://github.com/php/php-src/blob/e2189e5f376092eeaeb4c06ff9b5918bfc016917/Zend/zend_operators.c#L325

It seems _zendi_try_convert_scalar_to_number converts null to 0.

Do you know who decided this behavior ? 
Do you know how did this behavior come about? 

Regards.
Kazuki





[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