Re: [RFC] Strict operators directive
| From: | Guilliam Xavier | Date: | Tue, 25 Jun 2019 17:56:27 +0000 |
| Subject: | Re: [RFC] Strict operators directive | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-106055@lists.php.net to get a copy of this message | ||
On Tue, Jun 25, 2019 at 3:09 PM Arnold Daniels
<arnold.adaniels.nl@gmail.com> wrote:
>
> Hi all,
>
> I would like to open the discussion for RFC: "Strict operators directive".
>
> This RFC proposes a new directive 'strict_operators'. When enabled, operators may
> cast operands to the expected type, but must comply to;
>
> * Typecasting is not based on the type of the other operand
>
> * Typecasting is not based on the value of any of the operands
> * Operators will throw a TypeError for unsupported types
>
> Reasoning; The current rules for type casting done by operators are inconsistent and complex,
> which can lead to surprising results where a statement seemingly contradicts itself.
>
> Using a directive means that backwards compatibility is guaranteed.
>
> https://wiki.php.net/rfc/strict_operators
>
> Yours,
> Arnold Daniels
>
> [Arnold Daniels - Chat @
> Spike](https://www.spikenow.com/?ref=spike-organic-signature&_ts=1mzl6) [1mzl6]
Hello, thanks for the impressive work...
I have just one interrogation: why disallow
~ for strings?
(e.g. currently ~"\x00\x01\x02" gives "\xFF\xFE\xFD")
--
Guilliam Xavier