ReflectionConstant::getShortName
(PHP 8 >= 8.4.0)
ReflectionConstant::getShortName — Gets short name
说明
Gets the short name of the constant, the part without the namespace.
参数
此函数没有参数。
返回值
The short name of the constant.
示例
示例 #1 ReflectionConstant::getShortName() example
<?php
namespace Foo;
const BAR = 'bar';
echo (new \ReflectionConstant('Foo\BAR'))->getName();
?>
以上示例会输出:
BAR
参见
- ReflectionConstant::getName() - Gets name
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/reflectionconstant.getshortname.php