ReflectionConstant::getValue

値を取得する

説明

public mixed ReflectionConstant::getValue()

定数の値を取得します。

パラメータ

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

戻り値

定数の値を返します。

例1 ReflectionProperty::getValue の例

<?php
const FOO = 'foo';

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

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

string(3) "foo"