PHP Conference Nagoya 2025

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 __construct()
public getName(): string
public getTarget(): int
public isRepeated(): bool
}

Eigenschaften

name
The name of the attribute.

Vordefinierte Konstanten

ReflectionAttribute Flags

ReflectionAttribute::IS_INSTANCEOF

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 Added ReflectionAttribute::$name.

Inhaltsverzeichnis

add a note

User Contributed Notes

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