Re: [RFC] Comparison and conversion inconsistency - need more info
| From: | Yasuo Ohgaki | Date: | Sun, 10 Nov 2013 10:18:20 +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-70082@lists.php.net to get a copy of this message | ||
Hi Stas,
On Sun, Nov 10, 2013 at 7:06 PM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:
> > uses compare_function() later. There may be other array functions use
> > it. I'm not sure if there are 'internal' functions that does not perform
> > comparison(or conversion) non standard way like compare_function().
>
> compare_function *is* the standard way. That's what comparison operators
> use, just look at the code.
Yes, but the result differs when comparison is done as expression. (e.g. if
(expression))
I haven't look into this issue carefully yet, but simple test codes revel
the
difference. I guess engine is converting values in expression according to
context,
but not in min(). That's the reason why (expression) and min() result
differs,
I suppose. I would say it's a bug of min() calling compare_function() as it
is now.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net