Skip to content

Commit af12aa8

Browse files
committed
Merge branch 'concatenation_precedence'
2 parents 1ffa4d2 + 61ee869 commit af12aa8

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ PHP 8.0 UPGRADE NOTES
7070
will now always generate a fatal error. Previously a warning was generated
7171
in some cases.
7272
RFC: https://wiki.php.net/rfc/lsp_errors
73+
. The precendence of the concatenation operator has changed relative to
74+
bitshifts and addition as well as subtraction.
75+
RFC: https://wiki.php.net/rfc/concatenation_precedence
7376

7477
- COM:
7578
. Removed the ability to import case-insensitive constants from type

Zend/zend_ast.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,9 @@ ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn) {
910910
* 160 left &
911911
* 170 non-associative == != === !==
912912
* 180 non-associative < <= > >= <=>
913+
* 185 left .
913914
* 190 left << >>
914-
* 200 left + - .
915+
* 200 left + -
915916
* 210 left * / %
916917
* 220 right !
917918
* 230 non-associative instanceof
@@ -1733,7 +1734,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
17331734
case ZEND_MOD: BINARY_OP(" % ", 210, 210, 211);
17341735
case ZEND_SL: BINARY_OP(" << ", 190, 190, 191);
17351736
case ZEND_SR: BINARY_OP(" >> ", 190, 190, 191);
1736-
case ZEND_CONCAT: BINARY_OP(" . ", 200, 200, 201);
1737+
case ZEND_CONCAT: BINARY_OP(" . ", 185, 185, 186);
17371738
case ZEND_BW_OR: BINARY_OP(" | ", 140, 140, 141);
17381739
case ZEND_BW_AND: BINARY_OP(" & ", 160, 160, 161);
17391740
case ZEND_BW_XOR: BINARY_OP(" ^ ", 150, 150, 151);

Zend/zend_language_parser.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
7070
%left '&'
7171
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP
7272
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
73+
%left '.'
7374
%left T_SL T_SR
74-
%left '+' '-' '.'
75+
%left '+' '-'
7576
%left '*' '/' '%'
7677
%precedence '!'
7778
%precedence T_INSTANCEOF

0 commit comments

Comments
 (0)