You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User attributes declared with Attribute::IS_REPEATABLE must allow multiple instances on the same target, and ReflectionAttribute::isRepeated() must report whether each instance is a duplicate of an earlier one on that target. This compiler rejects all repeated attributes at compile time and does not register isRepeated() on the builtin ReflectionAttribute class.
php-src-strict: match Zend/zend_attributes.c (zend_is_attribute_repeated, zend_mark_attribute_repeatable) and ext/reflection/php_reflection.c (ReflectionAttribute::isRepeated).
2 / rep0 / norep1 (isRepeated() true only on first of duplicate pair)
VM
CompileError:Attribute "Rep" must not be repeated
Root cause sketch: lib/Compiler/AttributeNames.php::assertNoDuplicates() always fatals on duplicate names without reading the attribute class flags for IS_REPEATABLE (128). lib/VM/BuiltinClasses.php registers ReflectionAttribute with getName / getArguments / newInstance only — no isRepeated.
Related repro
Bitmask ctor args using named Attribute:: constants (non-literal fold) fail separately — see #6907 (sibling issue filed this run).
Compiler: when collecting attribute names on a target, skip assertNoDuplicates fatals for classes whose registered Attribute flags include IS_REPEATABLE; store instance index for reflection.
VM: add ReflectionAttribute::isRepeated(): bool on builtin class entry; populate from compile metadata in lib/VM/ReflectionSupport.php.
Summary
User attributes declared with
Attribute::IS_REPEATABLEmust allow multiple instances on the same target, andReflectionAttribute::isRepeated()must report whether each instance is a duplicate of an earlier one on that target. This compiler rejects all repeated attributes at compile time and does not registerisRepeated()on the builtinReflectionAttributeclass.php-src-strict: match
Zend/zend_attributes.c(zend_is_attribute_repeated,zend_mark_attribute_repeatable) andext/reflection/php_reflection.c(ReflectionAttribute::isRepeated).Repro (verified 2026-06-06, Docker
php-compiler:22.04-dev)2/rep0/norep1(isRepeated()true only on first of duplicate pair)Attribute "Rep" must not be repeatedRoot cause sketch:
lib/Compiler/AttributeNames.php::assertNoDuplicates()always fatals on duplicate names without reading the attribute classflagsforIS_REPEATABLE(128).lib/VM/BuiltinClasses.phpregistersReflectionAttributewithgetName/getArguments/newInstanceonly — noisRepeated.Related repro
Bitmask ctor args using named
Attribute::constants (non-literal fold) fail separately — see #6907 (sibling issue filed this run).php-src reference
#[Attribute]Zend/zend_attributes.c—zend_mark_attribute_repeatableZend/zend_compile.c—zend_is_attribute_repeatedext/reflection/php_reflection.c—ReflectionAttribute::isRepeatedImplementation (PHP-in-PHP)
assertNoDuplicatesfatals for classes whose registeredAttributeflags includeIS_REPEATABLE; store instance index for reflection.ReflectionAttribute::isRepeated(): boolon builtin class entry; populate from compile metadata inlib/VM/ReflectionSupport.php.getName/newInstance, Language: ReflectionAttribute::newInstance() — JIT/AOT (phase 2 of #3206, ext/reflection/php_reflection.c) #4598).Done when
test/repro/maintainer_attr_isrepeated2.phpmatches Zend on VMisRepeated() === true; second+:false(Zend parity)test/compliance/cases/language/attribute_is_repeatable.phptadded./script/ci-fast.sh --filter attribute_is_repeatablegreenVerification
Pairs with umbrella #4392 (attributes); claim this slice only.