rfc:concatenation_precedence
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:concatenation_precedence [2019/03/28 11:00] – PHP 8 only bwoebi | rfc:concatenation_precedence [2020/08/01 23:54] (current) – RFC was implemented carusogabriel | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Change the precedence of the concatenation operator ====== | ====== PHP RFC: Change the precedence of the concatenation operator ====== | ||
- | * Version: | + | * Version: |
* Date: 2019-03-28 | * Date: 2019-03-28 | ||
* Author: Bob Weinand, bobwei9@hotmail.com | * Author: Bob Weinand, bobwei9@hotmail.com | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 28: | Line 28: | ||
This is counter-intuitive though: you rarely want to add or subtract concatenated strings which in general are not numbers. However, given PHPs capability of seamlessly converting an integer to a string, concatenation of these values is desired. | This is counter-intuitive though: you rarely want to add or subtract concatenated strings which in general are not numbers. However, given PHPs capability of seamlessly converting an integer to a string, concatenation of these values is desired. | ||
- | Thus, the RFC proposes to give ' | + | Thus, the RFC proposes to give ' |
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | Every unparenthesized expression featuring an ' | + | Every unparenthesized expression featuring an ' |
While this is a subtle behavior change in that it will give different outputs without notice or warning, it is trivially possible to statically analyze the code and find all instances where this happens. As to my knowledge these occurrences are quite rare as it almost always is an error in the current form, rendering the impact minimal. | While this is a subtle behavior change in that it will give different outputs without notice or warning, it is trivially possible to statically analyze the code and find all instances where this happens. As to my knowledge these occurrences are quite rare as it almost always is an error in the current form, rendering the impact minimal. | ||
+ | |||
+ | As Nikita mentioned on the mailing list: http:// | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
Line 40: | Line 42: | ||
PHP 8, with a deprecation notice in PHP 7.4 upon encountering an unparenthesized expression containing an ' | PHP 8, with a deprecation notice in PHP 7.4 upon encountering an unparenthesized expression containing an ' | ||
- | ===== Proposed Voting Choices | + | ===== Vote ===== |
+ | |||
+ | Voting started 2019-04-30 and ends 2019-05-14. The first (primary) voting requires a 2/3 majority. The second (secondary) voting requires a 50%+1 majority. | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
- | "Change the precedence | + | <doodle title="Emit a deprecation notice |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Patch ===== | ===== Patch ===== | ||
- | The patch for the change itself is trivial, requiring small changes in the zend_ast.c and zend_language_parser.y to change the precendences. The emission of deprecation is a bit more contrived... I'll add it later. | + | * https:// |
+ | * https:// |
rfc/concatenation_precedence.1553770831.txt.gz · Last modified: 2019/03/28 11:00 by bwoebi