Skip to content

Commit 356538f

Browse files
committed
Test redeclaration of attributes throws error.
1 parent 03e2ece commit 356538f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6222,7 +6222,7 @@ static HashTable* zend_compile_resolve_attributes(HashTable *declared_attributes
62226222
zend_string *resolved_name;
62236223
zend_string *key;
62246224
// declared attributes are in structure: idx => ["class" => "...", 0 => arg1, 1 => arg2, ...]
6225-
// resolved attributes are in structure fqcn => [ [0 => arg1, 1 => arg2], [0 => arg12, 1 => arg22] ]
6225+
// resolved attributes are in structure fqcn => [0 => arg1, 1 => arg2, ..]
62266226
HashTable *resolved_attributes;
62276227

62286228
ALLOC_HASHTABLE(resolved_attributes);
@@ -6239,7 +6239,7 @@ static HashTable* zend_compile_resolve_attributes(HashTable *declared_attributes
62396239
if (val) {
62406240
array_init(val);
62416241
} else {
6242-
val = zend_hash_find(resolved_attributes, resolved_name);
6242+
zend_error_noreturn(E_COMPILE_ERROR, "Redeclared attribute %s", ZSTR_VAL(resolved_name));
62436243
}
62446244

62456245
zend_hash_next_index_insert(Z_ARRVAL_P(val), attr);

0 commit comments

Comments
 (0)