Re: Equality and relative ordering of objects
| From: | Levi Morrison | Date: | Mon, 25 Jun 2018 03:31:17 +0000 |
| Subject: | Re: Equality and relative ordering of objects | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-102407@lists.php.net to get a copy of this message | ||
On Sun, Jun 24, 2018 at 2:31 PM Rudi Theunissen <rtheunissen@php.net> wrote:
>>
>> Other languages (most? all?) separate equality and ordering for this reason.
>
>
> Java doesn't really separate them. Their
== always checks
> object reference so is like PHP's ===.
> But they do have the .equals() method on all objects (our ==) and the collections use that for
> equality.
Java has .equals and .compareTo; these operations are separate. In
Java neither integrates with operators.