summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-22 14:44:06 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-27 11:35:48 +0200
commit36ed9966ce791676dd435fd3ee5fc67a17bc09b2 (patch)
tree61acdbe5978158b6b2255e42a1fb24685dd9017c /Zend/zend_compile.c
parent2772751b58ee579a8f1288a0949e5e1fcb554877 (diff)
downloadphp-git-36ed9966ce791676dd435fd3ee5fc67a17bc09b2.tar.gz
Allow attributes to be applied to property/constant groups
Remove arbitrary restriction that attributes cannot be applied to property/constant groups. The attribute applies to all elements of the group, just like modifiers and types do. See also https://externals.io/message/111914. Closes GH-6186.
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index f0019f591c..7debd55acc 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7069,11 +7069,6 @@ void zend_compile_prop_group(zend_ast *ast) /* {{{ */
zend_ast *prop_ast = ast->child[1];
zend_ast *attr_ast = ast->child[2];
- if (attr_ast && zend_ast_get_list(prop_ast)->children > 1) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot apply attributes to a group of properties");
- return;
- }
-
zend_compile_prop_decl(prop_ast, type_ast, ast->attr, attr_ast);
}
/* }}} */
@@ -7130,12 +7125,6 @@ void zend_compile_class_const_group(zend_ast *ast) /* {{{ */
zend_ast *const_ast = ast->child[0];
zend_ast *attr_ast = ast->child[1];
- if (attr_ast && zend_ast_get_list(const_ast)->children > 1) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot apply attributes to a group of constants");
-
- return;
- }
-
zend_compile_class_const_decl(const_ast, ast->attr, attr_ast);
}
/* }}} */