rfc:arithmetic_operator_type_checks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:arithmetic_operator_type_checks [2020/04/02 08:03] – nikic | rfc:arithmetic_operator_type_checks [2020/04/14 12:49] – nikic | ||
---|---|---|---|
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 ===== |
rfc/arithmetic_operator_type_checks.txt · Last modified: 2020/05/05 14:12 by nikic