ReflectionParameter::getAttributes Получает атрибуты &reftitle.description; public arrayReflectionParameter::getAttributes stringnullname&null; intflags0 Возвращает все атрибуты, объявленные в этом параметре, в виде массива ReflectionAttribute. &reftitle.parameters; &reflection.getattributes.param.name; &reflection.getattributes.param.flags; &reftitle.returnvalues; Массив атрибутов в виде объекта ReflectionAttribute. &reftitle.examples; Простой пример getParameter('apple'); $attributes = $parameter->getAttributes(); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Fruit [1] => Red ) ]]> Фильтрация результатов по имени класса getParameter('apple'); $attributes = $parameter->getAttributes('Fruit'); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Fruit ) ]]> Фильтрация результатов по имени класса, с наследованием getParameter('apple'); $attributes = $parameter->getAttributes('Color', ReflectionAttribute::IS_INSTANCEOF); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Red ) ]]> &reftitle.seealso; ReflectionClass::getAttributes ReflectionClassConstant::getAttributes ReflectionFunctionAbstract::getAttributes ReflectionProperty::getAttributes