PHP Native Attribute¶
PHP supports a system of attributes, to add local configuration to methods, classes, etc. There are currently, as of PHP 8.5, 7 attributes:
AttributeAllowDynamicPropertiesReturnTypeWillChangeSensitiveParameterOverrideDeprecatedNoDiscardDelayedTargetValidation.
<?php
class X extends Y {
#[Override]
function foo() {
}
}
?>
See also PHP Native Attributes.
Related : Attribute, Allow Dynamic Properties, Return Type Will Change, Sensitive Parameter, Override Attribute, Deprecated, delayedtargetvalidation, NoDiscard, Overriding