# The ReflectionAttribute class

(PHP 8)

## Einführung

The ReflectionAttribute class provides information about an Attribute.

## Klassenbeschreibung

class ReflectionAttribute implements Reflector {
/* Konstanten */
public const int IS_INSTANCEOF;
/* Eigenschaften */
public string $name;
/* Methoden */
private function __construct()
public function getArguments(): array
public function getName(): string
public function getTarget(): int
public function isRepeated(): bool
public function newInstance(): object
}

## Eigenschaften

name
  The name of the attribute.

## Vordefinierte Konstanten

## ReflectionAttribute Flags

`ReflectionAttribute::IS_INSTANCEOF` int

  Retrieve attributes using an `instanceof` check.

> Hinweis:

> The values of these constants may change between PHP versions. It is recommended to always use the constants and not rely on the values directly.

## Changelog

Version | Beschreibung
--- | ---
8.4.0 | All class constants are now typed.
8.4.0 | Added ReflectionAttribute::$name.

## Inhaltsverzeichnis

- ReflectionAttribute::__construct — Private constructor to disallow direct instantiation
- ReflectionAttribute::getArguments — Gets arguments passed to attribute
- ReflectionAttribute::getName — Gets attribute name
- ReflectionAttribute::getTarget — Returns the target of the attribute as bitmask
- ReflectionAttribute::isRepeated — Returns whether the attribute of this name has been repeated on a code element
- ReflectionAttribute::newInstance — Instantiates the attribute class represented by this ReflectionAttribute class and arguments

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open