Introduzione
PHP Manual
PHP Manual»Reflection»ReflectionAttribute

The ReflectionAttribute class

(PHP 8)

The ReflectionAttribute class provides information about an Attribute.

class ReflectionAttribute implements Reflector {
/* Costanti */
public const int IS_INSTANCEOF;
/* Proprietà */
public string $name;
/* Metodi */
private function __construct()
public function getArguments(): array
public function getName(): string
public function getTarget(): int
public function isRepeated(): bool
public function newInstance(): object
}
name
The name of the attribute.
ReflectionAttribute::IS_INSTANCEOF int

Retrieve attributes using an instanceof check.

Nota:

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.

Versione Descrizione
8.4.0 All class constants are now typed.
8.4.0 Added ReflectionAttribute::$name.

Indice dei contenuti

To Top