diff --git a/reference/reflection/reflectionconstant/getattributes.xml b/reference/reflection/reflectionconstant/getattributes.xml new file mode 100644 index 000000000000..9720e1cafa2b --- /dev/null +++ b/reference/reflection/reflectionconstant/getattributes.xml @@ -0,0 +1,130 @@ + + + + + ReflectionConstant::getAttributes + Gets Attributes + + + + &reftitle.description; + + public arrayReflectionConstant::getAttributes + stringnullname&null; + intflags0 + + + Returns all attributes declared on this global constant as an array of ReflectionAttribute. + + + + + &reftitle.parameters; + + &reflection.getattributes.param.name; + &reflection.getattributes.param.flags; + + + + + &reftitle.returnvalues; + + Array of attributes, as ReflectionAttribute objects. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 8.5.0 + + This method was introduced. + + + + + + + + + + &reftitle.examples; + + + Basic usage + +getAttributes(); +print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); +?> +]]> + + &example.outputs; + + Fruit + [1] => Red +) +]]> + + + + + + + &reftitle.seealso; + + ReflectionClass::getAttributes + ReflectionClassConstant::getAttributes + ReflectionFunctionAbstract::getAttributes + ReflectionProperty::getAttributes + + + + +