Re: [RFC] Combined Comparison (Spaceship) Operator
| From: | Alain Williams | Date: | Fri, 23 Jan 2015 10:02:48 +0000 |
| Subject: | Re: [RFC] Combined Comparison (Spaceship) Operator | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81038@lists.php.net to get a copy of this message | ||
On Fri, Jan 23, 2015 at 12:24:25AM +0000, Andrea Faulds wrote:
> Having it be the same as === would be inconsistent with our existing sorting and comparison
> behaviour, so I don’t think it should be changed. If we made it strict like that, we’d also have
> to define a strict < and > as well, otherwise we have a problem, because in some cases ($x !==
> $y && !($x < $y) && !($x > $y)) is TRUE.
I think that you mentioned that you might come up with another RFC if <=> is
successful - that would be for a <==> operator.
You might want to mention that ... but it is more complicated if the operands
are of different types - what does it return in that case ? FALSE ? But the same
as <=> if the types are the same ?
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>