PHP Native Attribute

PHP supports a system of attribute, to add local configuration to methods, classes, etc. There are currently (PHP 8.3) 5 attributes:

  • Attribute

  • AllowDynamicProperties

  • ReturnTypeWillChange

  • SensitiveParameter

  • Override

<?php

class x extends y {
     #[Override]
     function foo() {

     }
}

?>

Documentation

See also PHP Native Attributes

Related : Attributes, Allow Dynamic Property, Return Type Will Change, Sensitive Parameter, Override Parent Method