Closed
Description
Scope of Change
This RFC suggests dropping annotation key/value pair syntax.
Rationale
Key/value pair syntax is redundant to simply using maps inside annotation values, not much shorter and requires extra effort in parsing.
#[@expect(class= FormatException::class)]
...is the same as:
#[@expect(['class' => FormatException::class])]
...which also already works today!
Functionality
- XP 10: Deprecation including notice
- XP 11: Removal, raises parse errors
Security considerations
n/a
Speed impact
Eventually faster once extra parser handling can be removed
Dependencies
Extra handling in https://github.com/xp-framework/compiler
Related documents
https://wiki.php.net/rfc/annotations_v2 - uses map syntax