Problem
#1354 ✅ and #1936 ✅ closed VM v1: attributes parse, lint, and compile; runtime ignores #[Attr] metadata in native paths. docs/capabilities-syntax.md still documents attributes as VM-only / reflection deferred.
Self-host and framework-style code may call ReflectionClass::getAttributes() / ReflectionMethod::getAttributes() — today that path is unsupported or stubbed in JIT/AOT binaries.
Goal (v1 subset)
| Layer |
Target |
| VM |
Store attribute metadata on declared class/method/property nodes |
| JIT/AOT |
Emit const attribute name/arg blobs for spine-smoke units |
| Reflection |
Read path for getAttributes() on declared items — not full newInstance() with arbitrary constructors |
Implementation hints
| Piece |
Path |
Notes |
| Compiler |
lib/Compiler.php |
Attach attribute list to class/method IR (#1354 hooks) |
| VM |
lib/VM.php, reflection helpers |
Backing store for ReflectionAttribute |
| JIT |
lib/JIT.php |
Const metadata blobs; defer dynamic instantiation |
| AOT |
lib/AOT/ |
Link metadata section |
| Tests |
test/compliance/cases/attribute_reflection_*.phpt |
Zend subset |
| Capabilities |
php script/capability-syntax.php |
Flip syntax row when JIT/AOT green |
Out of scope (v1)
Acceptance criteria
Verification (local / Docker only)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter Attribute'
./script/ci-fast.sh --filter Attribute
make test-harness # when JIT touched
No GitHub Actions (#394 ✅).
Dependencies
Links
Problem
#1354 ✅ and #1936 ✅ closed VM v1: attributes parse, lint, and compile; runtime ignores
#[Attr]metadata in native paths.docs/capabilities-syntax.mdstill documents attributes as VM-only / reflection deferred.Self-host and framework-style code may call
ReflectionClass::getAttributes()/ReflectionMethod::getAttributes()— today that path is unsupported or stubbed in JIT/AOT binaries.Goal (v1 subset)
getAttributes()on declared items — not fullnewInstance()with arbitrary constructorsImplementation hints
lib/Compiler.phplib/VM.php, reflection helpersReflectionAttributelib/JIT.phplib/AOT/test/compliance/cases/attribute_reflection_*.phptphp script/capability-syntax.phpOut of scope (v1)
newInstance()with user constructorsAcceptance criteria
ReflectionClass::getAttributes()on VM@group llvmand LLVM presentphp script/capability-syntax.phpupdates attributes rowphp script/bootstrap-inventory.php --checkstill clean or documented deltaVerification (local / Docker only)
No GitHub Actions (#394 ✅).
Dependencies
Links
docs/roadmap-wave3.mdattributes row