Re: [RFC] Comparison and conversion inconsistency - need more info
| From: | Stas Malyshev | Date: | Sat, 09 Nov 2013 08:28:24 +0000 |
| Subject: | Re: [RFC] Comparison and conversion inconsistency - need more info | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70067@lists.php.net to get a copy of this message | ||
Hi!
> I was surprised that wired min() behavior.
> The cause of this behavior is in Zend API.
>
> https://bugs.php.net/bug.php?id=53104
>
> So I've made FRC to discuss/document/fix such behavior.
>
> If anyone know such behavior, please let me know so that I can write them
> in the RFC.
In the engine, null is less than -1. Changing it would be a very
profound compatibility break, so I do not think it can be done in any
5.x version.
Current behavior is described here in detail:
http://php.net/manual/en/language.operators.comparison.php
Null is the same as false in this case, which is less than any non-false
value. -1 is a non-false value.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227