-
Notifications
You must be signed in to change notification settings - Fork 0
PHP Native Attributes
macropay-solutions edited this page Aug 6, 2025
·
6 revisions
Based on https://www.php.net/manual/en/reserved.attributes.php these are the PHP Native Attributes that can be used as the only option because they don't have a PHP code alternative (not annotation).
- ReturnTypeWillChange PHP >= 8.1
- AllowDynamicProperties PHP >= 8.2
- SensitiveParameter PHP >= 8.2
- Override PHP 8.3
- Deprecated PHP >= 8.4
Any other custom PHP Attribute that is based on Attribute attribute will need Reflection adding extra execution steps and scattering the logic throughout your entire code base instead of keeping things grouped. An example would be routes declaration in Controller via Attributes vs in a single place.