rfc:arithmetic_operator_type_checks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:arithmetic_operator_type_checks [2020/04/02 08:03] – nikic | rfc:arithmetic_operator_type_checks [2020/04/30 08:33] – nikic | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Date: 2020-04-02 | * 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 14: | Line 14: | ||
<PHP> | <PHP> | ||
var_dump([] % [42]); | var_dump([] % [42]); | ||
- | // int(1) | + | // int(0) |
// WTF? | // WTF? | ||
</ | </ | ||
Line 62: | Line 62: | ||
The changes proposed here are intended to be entirely uncontroversial. | The changes proposed here are intended to be entirely uncontroversial. | ||
- | ===== Open Questions | + | ===== Backward Incompatible Changes |
- | It might be worthwhile to go one step further: | + | Using an array, resource or object in an arithmetic/ |
- | | + | ===== Future Scope ===== |
+ | |||
+ | In the future, we may wish to go one step further: | ||
+ | |||
+ | | ||
* Make overflowing float values throwing for operators that expect an integer ('' | * 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 '' | This would have the advantage of aligning the semantics with parameter type checks in coercive mode, for the types '' | ||
- | ===== Backward Incompatible Changes ===== | + | I'm leaving this potential improvement out of this RFC, because |
- | + | ||
- | Using an array, resource or object in an arithmetic/ | + | |
===== Vote ===== | ===== Vote ===== | ||
- | Yes/No. | + | Voting started 2020-04-16 and ends 2020-04-30. |
+ | <doodle title=" | ||
+ | * yes | ||
+ | * no | ||
+ | </ |
rfc/arithmetic_operator_type_checks.txt · Last modified: 2020/05/05 14:12 by nikic