Re: Equality and relative ordering of objects
| From: | Levi Morrison | Date: | Fri, 22 Jun 2018 12:42:47 +0000 |
| Subject: | Re: Equality and relative ordering of objects | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-102368@lists.php.net to get a copy of this message | ||
On Fri, Jun 22, 2018 at 6:39 AM Levi Morrison <levim@php.net> wrote:
>
>
> > 1. You can't override the behaviour of
<,
> > <=, >,
> > >=, ==,
> > !=
> > with a userland implementation.
> > 2. Therefore, you won't be able to affect the internals of array functions
> > like in_array, sort etc.
>
> In my opinion we should have functions which take comparator and/or equality functions as
> parameters even if we can override these operators. I'd like to see an outline of such a plan
> as part of this RFC or as a precursor to it.
(I know some already have this option, such as usort, but we don't
have an in_array that takes an equality callback, correct?)