The Deprecated attributeIntroduction
This attribute is used to mark functionality as deprecated.
Using deprecated functionality will cause an As of PHP 8.5.0, this attribute can also be applied to traits and to compile-time constants declared outside of a class. Class synopsis
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::TARGET_CONSTANT | \Attribute::TARGET_CLASS)]
final
Deprecated
/* Properties */
public
readonly
stringnull
$message;
public
readonly
stringnull
$since;
/* Methods */
public __construct(stringnull
$message = null, stringnull $since = null)Properties
ExamplesOutput of the above example in PHP 8.4 is similar to: Deprecated: Function unsafe_function() is deprecated since 1.5, use safe_replacement() instead in example.php on line 9 This is unsafe Changelog
See Also
|