ReflectionClass::getAttributes Pobiera Atrybuty &reftitle.description; public arrayReflectionClass::getAttributes stringnullname&null; intflags0 Zwraca wszystkie atrybuty zdeklarowane dla tej klasy jako tablicę ReflectionAttribute. &reftitle.parameters; &reflection.getattributes.param.name; &reflection.getattributes.param.flags; &reftitle.returnvalues; Tablica atrybutów jako obiekty ReflectionAttribute. &reftitle.examples; Podstawowe użycie getAttributes(); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Owoc [1] => Czerwony ) ]]> Filtrowanie wyników po nazwie klasy getAttributes('Owoc'); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Owoc ) ]]> Filtrowanie wyników po nazwie klasy, z uwzględnieniem dziedziczenia getAttributes(Kolor::class, ReflectionAttribute::IS_INSTANCEOF); print_r(array_map(fn($attribute) => $attribute->getName(), $attributes)); ?> ]]> &example.outputs; Czerwony ) ]]> &reftitle.seealso; ReflectionClassConstant::getAttributes ReflectionFunctionAbstract::getAttributes ReflectionParameter::getAttributes ReflectionProperty::getAttributes