Re: [RFC] Comparison and conversion inconsistency - need more info
| From: | Yasuo Ohgaki | Date: | Sun, 10 Nov 2013 09:14:38 +0000 |
| Subject: | Re: [RFC] Comparison and conversion inconsistency - need more info | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70075@lists.php.net to get a copy of this message | ||
Hi Sanford,
On Sun, Nov 10, 2013 at 6:07 PM, Sanford Whiteman <
swhitemanlistens-software@cypressintegrated.com> wrote:
> > -----------------------------------
> > if (-1 < NULL)
> > echo 'NULL is smaller';
> > else
> > echo '-1 is smaller';
> > -----------------------------------
> > returns '-1 is smaller' as all of us expects.
>
> Please go over the conditions and the echos in this example one more
> time.
I think I understand your argument as I know languages that treat null/nil
as special value.
I just think
min(-10000, -1000, -100, NULL, 100, 1000) returns NULL.
is not following standard PHP comparison rules.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net