ReflectionFunctionAbstract::getAttributes Devuelve los atributos &reftitle.description; public arrayReflectionFunctionAbstract::getAttributes stringnullname&null; intflags0 Devuelve todos los atributos declarados en esta función o método en forma de un array de objetos ReflectionAttribute. &reftitle.parameters; &reflection.getattributes.param.name; &reflection.getattributes.param.flags; &reftitle.returnvalues; Un array de atributos, en forma de objetos ReflectionAttribute. &reftitle.examples; Uso básico con un método de clase getAttributes(); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Fruit [1] => Red ) ]]> Uso básico con una función getAttributes(); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Fruit [1] => Red ) ]]> Resultados filtrados por nombre de clase getAttributes('Fruit'); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Fruit ) ]]> Resultados filtrados por nombre de clase, con herencia getAttributes('Color', ReflectionAttribute::IS_INSTANCEOF); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Red ) ]]> &reftitle.seealso; ReflectionClass::getAttributes ReflectionClassConstant::getAttributes ReflectionParameter::getAttributes ReflectionProperty::getAttributes