ReflectionClassConstant::isDeprecated
(PHP 8 >= 8.4.0)
ReflectionClassConstant::isDeprecated — Checks if deprecated
说明
Checks whether the class constant is deprecated.
参数
此函数没有参数。
示例
示例 #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());
?>
以上示例会输出:
bool(true)
参见
- Deprecated
- ReflectionClassConstant::getDocComment() - Gets doc comments
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/reflectionclassconstant.isdeprecated.php