« ReflectionConstant::getNamespaceName
ReflectionConstant::getValue »

ReflectionConstant::getShortName

(PHP 8 >= 8.4.0)

ReflectionConstant::getShortName — 短い名前を取得する

説明

public function ReflectionConstant::getShortName(): string

名前空間部分を除いた、定数の短い名前を取得します。

パラメータ

この関数にはパラメータはありません。

戻り値

定数の短い名前を返します。

例

例1 ReflectionConstant::getShortName() の例

<?php
namespace Foo;

const BAR = 'bar';

echo (new \ReflectionConstant('Foo\BAR'))->getShortName();
?>

上の例の出力は以下となります。

BAR

参考

関連キーワード:
ReflectionConstant   getShortName   定数   getNamespaceName   getValue   空間   namespace   参考   getName
関連する関数・ページ:
reflectionconstant.getname   reflectionconstant.getvalue   class.reflectionconstant   reflectionconstant.construct   reflectionconstant.getnamespacename   reflectionconstant.getfilename