Re: [RFC] Spaceship operator RFC
| From: | Christoph Becker | Date: | Mon, 20 Apr 2015 13:43:52 +0000 |
| Subject: | Re: [RFC] Spaceship operator RFC | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85877@lists.php.net to get a copy of this message | ||
Hi!
Stanislav Malyshev wrote:
> Ahh, I see. I think it's the mistake in the RFC. [...]
Then it is probably best to fix the RFC. :)
> I'm not a big fan of throwing too many notices. They are usually not
> very helpful an din this case it would be not easy to distinguish
> between intentional and unintentional use.
<snip>
> $a > $b being false is an artifact of how ">" works in the engine - $a >
> $b is essentially ($b < $a). Since in this case both $a > $b and $b >
> $a, the result of ($b < $a) is false. That's what you get when you
> compare non-well-ordered things...
I get your point. I suggest to amend the documentation[1] to make it
clear that comparing non-well-ordered values results in undefined
behavior (it might be best to treat the return value 1 in this case as
implementation specific).
[1] <http://php.net/manual/en/language.operators.comparison.php>
--
Christoph M. Becker