The ReflectionAttribute class

Introduction

The ReflectionAttribute class provides information about an Attribute.

Class synopsis

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

Properties

name
The name of the attribute.

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.

Changelog

Version Description
8.4.0 Added ReflectionAttribute::$name.
Table of Contents