ReflectionConstant::getShortName
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.4.0)
Gets short name
Description
ReflectionConstant::getShortName(): string
Gets the short name of the constant, the part without the namespace.
Parameters Parameters
Return Values
The short name of the constant.
Examples
ReflectionConstant::getShortName example
php
<?php
namespace Foo;
const BAR = 'bar';
echo (new \ReflectionConstant('Foo\BAR'))->getShortName();
?>The above example will output:
output
BARSee Also
ReflectionConstant::getName