Re: [VOTE] Combined Comparison (Spaceship) Operator
| From: | Markus Fischer | Date: | Mon, 02 Feb 2015 14:28:31 +0000 |
| Subject: | Re: [VOTE] Combined Comparison (Spaceship) Operator | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81589@lists.php.net to get a copy of this message | ||
On 02.02.15 14:49, Nikita Popov wrote:
> I've voted -1 because I think this should be a function and not an
> operator. compare($a, $b) is more obvious than $a <=> $b and it's not like
> writing comparison functions is such a super common use case that it needs
> the extra brevity of an operator. A function can furthermore be used as a
> callback, while an operator requires a wrapping closure.
I support what Nikita said, but it doesn't influence my vote; I see them
separate.
Btw, I would be hesitant to introduce such a common name 'compare'.
thanks,
- Markus