From: Bob Weinand Date: Thu, 16 May 2019 16:31:28 +0000 (+0200) Subject: Merge branch 'deprecate_concat_add_sub' into PHP-8.4 X-Git-Tag: php-7.4.0alpha1~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbc90b1f6e97cfa5b8ff990f9343c684bd1039a4;p=php Merge branch 'deprecate_concat_add_sub' into PHP-8.4 --- cbc90b1f6e97cfa5b8ff990f9343c684bd1039a4 diff --cc Zend/zend_language_parser.y index 22394868ba,4c2a7fdce7..b20c619f05 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@@ -961,10 -957,7 +961,11 @@@ expr { $$ = zend_ast_create_binary_op(ZEND_SPACESHIP, $1, $3); } | expr T_INSTANCEOF class_name_reference { $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); } - | '(' expr ')' { $$ = $2; if ($$->kind == ZEND_AST_BINARY_OP && $$->attr == ZEND_CONCAT) $$->attr = ZEND_PARENTHESIZED_CONCAT; } + | '(' expr ')' { + $$ = $2; + if ($$->kind == ZEND_AST_CONDITIONAL) $$->attr = ZEND_PARENTHESIZED_CONDITIONAL; ++ if ($$->kind == ZEND_AST_BINARY_OP && $$->attr == ZEND_CONCAT) $$->attr = ZEND_PARENTHESIZED_CONCAT; + } | new_expr { $$ = $1; } | expr '?' expr ':' expr { $$ = zend_ast_create(ZEND_AST_CONDITIONAL, $1, $3, $5); }