Hey Arnold, Perhaps it makes sense for <=> to still operate with other types, as long as they are uniform? Specifically:
* error: 1 <=> "1" * ok: "a" <=> "b" * ok: true <=> false Similar for sorting: I use <=> to differentiate multi-dimensional arrays: perhaps it should error if the array structure differs? The rest of the proposal makes a lot of sense to me. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Mon, Jul 6, 2020 at 5:27 PM Arnold Daniels <arnold.adaniels...@gmail.com> wrote: > Hi all, > > I'd like to start the discussion of the "Strict operators directive" RFC > version 1.5. This RFC proposes a new directive strict_operators, which > limits the type juggling done by operators to avoid unexpected results. > > https://wiki.php.net/rfc/strict_operators > > There are some significant changes from the previous version. > strict_operators no longer has cases where it changes the outcome of an > operation. To achieve this the following changes are made to the RFC > > * All comparison operators, besides `===` and `!==`, only accept `int` and > `float` operands. For any other type a `TypeError` is thrown. This includes > `==` and `!=`. > * The `switch` statement is not affected. > > For frequently asked questions please see > https://wiki.php.net/rfc/strict_operators/faq. > > [Arnold Daniels - Chat @ Spike]( > https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=l1bam) > [l1bam]