[RFC] Strict operators directive
| From: | Arnold Daniels | Date: | Tue, 25 Jun 2019 13:09:40 +0000 |
| Subject: | [RFC] Strict operators directive | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-106054@lists.php.net to get a copy of this message | ||
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]