Skip to content

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).

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.