On Thu, Feb 19, 2015 at 10:40 PM, Adam Harvey wrote:
> Hi all,
>
> Those of you with long memories will remember that I proposed a
> Comparable interface way back in the pre-5.4 days, but withdrew it
> when it became obvious that there was no consensus for it as a feature
> and that a vote was li
On 19.02.15 22:40, Adam Harvey wrote:
> Those of you with long memories will remember that I proposed a
> Comparable interface way back in the pre-5.4 days, but withdrew it
> when it became obvious that there was no consensus for it as a feature
> and that a vote was likely to fail.
>
> RFC: https
Hi Adam,
Am 19.02.2015 um 22:40 schrieb Adam Harvey:
> RFC: https://wiki.php.net/rfc/comparable
> PR: https://github.com/php/php-src/pull/1097
I see a little problem here by allowing any comparison. Comparing is
used for ordering, but you can easily construct ordering mechanisms that
simply don't
On Thu, Feb 19, 2015 at 1:40 PM, Adam Harvey wrote:
> Hi all,
>
> Those of you with long memories will remember that I proposed a
> Comparable interface way back in the pre-5.4 days, but withdrew it
> when it became obvious that there was no consensus for it as a feature
> and that a vote was like
>> But even here I would rather just take a function instead of requiring
>> it to be the instance of some interface:
>>
>> function sort($input, callable $comparator($a, $b): int) {
>> /* … */
>> }
>
> Fair, but the sorting case isn't the only one that matters,
> particularly with <=> now as p
I don't want to get into a lengthy debate (you have your opinion; I
have mine!), but to rebut a couple of specific points:
On 19 February 2015 at 14:19, Levi Morrison wrote:
> Another issue: it allows comparing an object to non-objects (even
> though the stated goal is only to compare two objects
> Those of you with long memories will remember that I proposed a
> Comparable interface way back in the pre-5.4 days, but withdrew it
> when it became obvious that there was no consensus for it as a feature
> and that a vote was likely to fail.
>
> RFC: https://wiki.php.net/rfc/comparable
> PR: ht