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
PHP 8 attributes (#[Route('/home')], #[\AllowDynamicProperties]) appear in modern frameworks and on paths toward self-host (vendor/php-cfg may carry attribute nodes). The compiler today does not lower attributes — lint may reject decorated declarations or php-cfg may drop metadata silently.
./phpc lint -r '#[\AllowDynamicProperties] class C {}'
./phpc run -r '#[\AllowDynamicProperties] class C {} new C(); echo "ok";'
./script/ci-fast.sh --filter Attribute
Problem
PHP 8 attributes (
#[Route('/home')],#[\AllowDynamicProperties]) appear in modern frameworks and on paths toward self-host (vendor/php-cfg may carry attribute nodes). The compiler today does not lower attributes — lint may reject decorated declarations or php-cfg may drop metadata silently.Wave 3 finish line #1751 tracks landing this with #1360, #1366, #1378.
Goal (minimum viable v1)
UnsupportedRegistryblock when VM accepts decorated declarations.Defer: JIT/AOT attribute reflection, compile-time
#[\Attribute]validation, enum attribute targets.Implementation hints
vendor/nikic/php-parserAttributeGroup,Attributenodes on PHP 8.2 hostlib/Compiler.phpClass_,ClassMethod,Propertylib/VM.phplib/Lint/UnsupportedRegistry.phpSelfHostBuiltinPolicydocs/capabilities-syntax.mdphp script/capability-syntax.phpTests
test/compliance/cases/attribute_class.phpt— class with#[\AllowDynamicProperties]instantiatestest/compliance/cases/attribute_method.phpt— method attribute ignored at runtimetest/unit/AttributeParseTest.php— lint green on decorated stubUnblock order
Compiler::compileClassAcceptance criteria
Docker:
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./script/ci-fast.sh --filter AttributeNo GitHub Actions.
Dependencies
Links
docs/capabilities-syntax.md