On Mon, Sep 16, 2024 at 6:08 AM Rob Landers <rob@bottled.codes> wrote:

> On Mon, Sep 16, 2024, at 09:47, Jordan LeDoux wrote:
>
> The reason for this was to prevent developers from creating situations
> where `5 > $foo` is true and `5 < $foo` is true.
>
>
> Just to point out: currently, PHP already does nonsensical comparisons:
>
> https://3v4l.org/BZfc8
>
> Granted, it is 'technically' correct that ($a <= $b || $b <= $a) ===
> false; but this really should be an error IMHO instead of a non-logical
> result.
>
> — Rob
>

Yes, the default comparisons for objects is a little strange. This should
be helped by Gina's RFC which I mentioned in my original email. The main
issue is that at the moment Equatable and Orderable are inseparable within
the PHP engine.

Jordan

Reply via email to