PHP - Manual: ReflectionConstant::getValue
2025-03-12
(PHP 8 >= 8.4.0)
ReflectionConstant::getValue — Gets value
此函数没有参数。
The value of the constant.
示例 #1 ReflectionProperty::getValue() example
<?php
const FOO = 'foo';
var_dump((new \ReflectionConstant('FOO'))->getValue());
?>
以上示例会输出:
string(3) "foo"
官方地址:https://www.php.net/manual/en/reflectionconstant.getvalue.php