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
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
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.
...is the same as:
#[@expect(['class' => FormatException::class])]...which also already works today!
Functionality
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