ReflectionConstant::getShortName
(PHP 8 >= 8.4.0)
ReflectionConstant::getShortName — Gets short name
Description
Gets the short name of the constant, the part without the namespace.
Parameters
This function has no parameters.
Return Values
The short name of the constant.
Examples
Example #1 ReflectionConstant::getShortName() example
<?php
namespace Foo;
const BAR = 'bar';
echo (new \ReflectionConstant('Foo\BAR'))->getShortName();
?>The above example will output:
BAR
See Also
- ReflectionConstant::getName() - Gets name
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
