The ReflectionAttribute class

(PHP 8)

Introduction

The ReflectionAttribute class provides information about an Attribute.

Class synopsis

class ReflectionAttribute implements Reflector {
/* Constants */
public const int IS_INSTANCEOF;
/* Methods */
private __construct()
public getArguments(): array
public getName(): string
public getTarget(): int
public isRepeated(): bool
public newInstance(): object
}

Predefined Constants

ReflectionAttribute Flags

ReflectionAttribute::IS_INSTANCEOF

Retrieve attributes using an instanceof check.

Note:

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.

Table of Contents