ReflectionClass::getConstant 获取已定义的常量 &reftitle.description; public mixedReflectionClass::getConstant stringname 获取已定义的常量。 &reftitle.parameters; name 要获取的类常量的名称。 &reftitle.returnvalues; 常量名称为 name 的值。 如果在类中没有找到该常量,则返回 &false; 。 &reftitle.examples; 使用 <methodname>ReflectionClass::getConstant</methodname> getConstant('C1')); var_dump($reflection->getConstant('C2')); var_dump($reflection->getConstant('C3')); ?> ]]> &example.outputs; &reftitle.seealso; ReflectionClass::getConstants