ReflectionConstant::getName

(PHP 8 >= 8.4.0)

ReflectionConstant::getName定数名を取得する

説明

public ReflectionConstant::getName(): string

定数名を取得します。

パラメータ

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

戻り値

名前空間と名前で構成された定数名を返します。

例1 ReflectionConstant::getName() の例

<?php
namespace Foo;

const
BAR = 'bar';

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

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

Foo\BAR

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top