ReflectionClass::getReflectionConstants クラス定数を取得する &reftitle.description; public arrayReflectionClass::getReflectionConstants intnullfilter&null; リフレクションされた定数を取得します。 &reftitle.parameters; filter オプションのフィルタで、取得したい定数の型を絞り込みます。 ReflectionClassConstant の定数 で設定し、デフォルトではすべての定数を取得します。 &reftitle.returnvalues; ReflectionClassConstant の配列を返します。 &reftitle.changelog; &Version; &Description; 8.0.0 filter が追加されました。 &reftitle.examples; 基本的な <function>ReflectionClass::getReflectionConstants</function> の例 getReflectionConstants(); foreach ($consts as $const) { print $const->getName() . "\n"; } var_dump($consts); ?> ]]> &example.outputs.similar; object(ReflectionClassConstant)#3 (2) { ["name"]=> string(3) "FOO" ["class"]=> string(3) "Foo" } [1]=> object(ReflectionClassConstant)#4 (2) { ["name"]=> string(3) "BAR" ["class"]=> string(3) "Foo" } [2]=> object(ReflectionClassConstant)#5 (2) { ["name"]=> string(3) "BAZ" ["class"]=> string(3) "Foo" } } ]]> &reftitle.seealso; ReflectionClass::getReflectionConstant ReflectionClassConstant