rfc:arithmetic_operator_type_checks
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
rfc:arithmetic_operator_type_checks [2020/04/01 13:54] – created nikic | rfc:arithmetic_operator_type_checks [2020/04/02 08:03] – nikic | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Stricter type checks for arithmetic/ | ====== PHP RFC: Stricter type checks for arithmetic/ | ||
- | * Date: 2020-04-01 | + | * Date: 2020-04-02 |
* Author: Nikita Popov < | * Author: Nikita Popov < | ||
- | * Status: | + | * Status: |
* Target Version: PHP 8.0 | * Target Version: PHP 8.0 | ||
* Implementation: | * Implementation: | ||
Line 61: | Line 61: | ||
The changes proposed here are intended to be entirely uncontroversial. | The changes proposed here are intended to be entirely uncontroversial. | ||
+ | |||
+ | ===== Open Questions ===== | ||
+ | |||
+ | It might be worthwhile to go one step further: | ||
+ | |||
+ | * Make non-numeric string operands throwing. Non-numeric here means not starting with a digit (optionally preceded by whitespace). This would not apply to operators that have special behavior for strings, such as string increment. | ||
+ | * Make overflowing float values throwing for operators that expect an integer ('' | ||
+ | |||
+ | This would have the advantage of aligning the semantics with parameter type checks in coercive mode, for the types '' | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== |
rfc/arithmetic_operator_type_checks.txt · Last modified: 2020/05/05 14:12 by nikic