« ReflectionConstant::getShortName
ReflectionConstant::isDeprecated »

ReflectionConstant::getValue

(PHP 8 >= 8.4.0)

ReflectionConstant::getValue — 値を取得する

説明

public function ReflectionConstant::getValue(): mixed

定数の値を取得します。

パラメータ

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

戻り値

定数の値を返します。

例

例1 ReflectionProperty::getValue() の例

<?php
const FOO = 'foo';

var_dump((new \ReflectionConstant('FOO'))->getValue());
?>

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

string(3) "foo"
関連キーワード:
ReflectionConstant   getValue   定数   getShortName   isDeprecated   mixed   ReflectionProperty   dump
関連する関数・ページ:
reflectionconstant.getshortname   class.reflectionconstant   reflectionconstant.construct   reflectionconstant.isdeprecated   reflectionconstant.getname   reflectionconstant.getfilename