Re: [PHP-DEV] [RFC][DISCUSSION] Strict operators directive

2020-07-06 Thread Arnold Daniels
On Mon, Jul 6, 2020 at 6:33 PM Benjamin Eberlei wrote: > > > 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_

Re: [PHP-DEV] [RFC][DISCUSSION] Strict operators directive

2020-07-06 Thread Arnold Daniels
On Mon, Jul 6, 2020 at 6:22 PM Marco Pivetta wrote: > 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 > Using `==`, `!=`, and `<=>` with string oper

Re: [PHP-DEV] [RFC][DISCUSSION] Strict operators directive

2020-07-06 Thread Benjamin Eberlei
On Mon, Jul 6, 2020 at 5:27 PM Arnold Daniels 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:

Re: [PHP-DEV] [RFC][DISCUSSION] Strict operators directive

2020-07-06 Thread Marco Pivetta
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 str