summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2019-05-16 18:31:28 +0200
committerBob Weinand <bobwei9@hotmail.com>2019-05-16 18:31:28 +0200
commitcbc90b1f6e97cfa5b8ff990f9343c684bd1039a4 (patch)
tree3e636176d86c2783f7460643bf58ca90e6fd5f8a /Zend/zend_compile.c
parentab2710c8d0261b4e3a5b1efcd86256134b9905d0 (diff)
parent3b23694aac62ad9c2dfdb60cafb304f9fc0b7c04 (diff)
downloadphp-git-cbc90b1f6e97cfa5b8ff990f9343c684bd1039a4.tar.gz
Merge branch 'deprecate_concat_add_sub' into PHP-8.4
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 155844e2e0..303aefcf9d 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7069,6 +7069,16 @@ void zend_compile_binary_op(znode *result, zend_ast *ast) /* {{{ */
zend_ast *right_ast = ast->child[1];
uint32_t opcode = ast->attr;
+ if ((opcode == ZEND_ADD || opcode == ZEND_SUB) && left_ast->kind == ZEND_AST_BINARY_OP && left_ast->attr == ZEND_CONCAT) {
+ zend_error(E_DEPRECATED, "The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence");
+ }
+ if ((opcode == ZEND_SL || opcode == ZEND_SR) && ((left_ast->kind == ZEND_AST_BINARY_OP && left_ast->attr == ZEND_CONCAT) || (right_ast->kind == ZEND_AST_BINARY_OP && right_ast->attr == ZEND_CONCAT))) {
+ zend_error(E_DEPRECATED, "The behavior of unparenthesized expressions containing both '.' and '>>'/'<<' will change in PHP 8: '<<'/'>>' will take a higher precedence");
+ }
+ if (opcode == ZEND_PARENTHESIZED_CONCAT) {
+ opcode = ZEND_CONCAT;
+ }
+
znode left_node, right_node;
zend_compile_expr(&left_node, left_ast);
zend_compile_expr(&right_node, right_ast);