ReflectionClassConstant::isDeprecated
(PHP 8 >= 8.4.0)
ReflectionClassConstant::isDeprecated — Checks if deprecated
Description
Checks whether the class constant is deprecated.
Parameters
This function has no parameters.
Examples
Example #1 ReflectionClassConstant::isDeprecated() example
<?php
class Basket {
#[\Deprecated(message: 'use Basket::APPLE instead')]
public const APLE = 'apple';
public const APPLE = 'apple';
}
$classConstant = new ReflectionClassConstant('Basket', 'APLE');
var_dump($classConstant->isDeprecated());
?>The above example will output:
bool(true)
See Also
- Deprecated
- ReflectionClassConstant::getDocComment() - Gets doc comments
↑ and ↓ to navigate • Enter to select • Esc to close • / to open