The ReflectionAttribute class

(PHP 8)

Introducción

The ReflectionAttribute class provides information about an Attribute.

Sinopsis de la Clase

class ReflectionAttribute implements Reflector {
/* Constantes */
public const int IS_INSTANCEOF;
/* Propiedades */
public string $name;
/* Métodos */
private __construct()
public getName(): string
public getTarget(): int
public isRepeated(): bool
}

Propiedades

name
The name of the attribute.

Constantes predefinidas

ReflectionAttribute Flags

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.

Historial de cambios

Versión Descripción
8.4.0 All class constants are now typed.
8.4.0 Added ReflectionAttribute::$name.

Tabla de contenidos

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top