ReflectionClass::getReflectionConstants
Gets class constants
&reftitle.description;
public arrayReflectionClass::getReflectionConstants
intnullfilter&null;
Retrieves reflected constants.
&reftitle.parameters;
filter
The optional filter, for filtering desired constant visibilities. It's configured using
the ReflectionClassConstant constants,
and defaults to all constant visibilities.
&reftitle.returnvalues;
An array of ReflectionClassConstant objects.
&reftitle.changelog;
&Version;
&Description;
8.0.0
filter has been added.
&reftitle.examples;
Basic ReflectionClass::getReflectionConstants example
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