if (zend_is_call(source_ast)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else if (source_ast->kind == ZEND_AST_NEW) {
+ zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated");
opline->extended_value = ZEND_RETURNS_NEW;
}
}
{ $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
| variable '=' '&' variable
{ $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
- | variable '=' '&' T_NEW class_name_reference ctor_arguments
- { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated");
- $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1,
- zend_ast_create(ZEND_AST_NEW, $5, $6)); }
+ | variable '=' '&' new_expr
+ { $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
| T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
| variable T_PLUS_EQUAL expr
{ $$ = zend_ast_create_assign_op(ZEND_ASSIGN_ADD, $1, $3); }