PHP 8.1.15 Released!

The Attribute class

(PHP 8)

Einführung

Attributes offer the ability to add structured, machine-readable metadata information on declarations in code: Classes, methods, functions, parameters, properties and class constants can be the target of an attribute. The metadata defined by attributes can then be inspected at runtime using the Reflection APIs. Attributes could therefore be thought of as a configuration language embedded directly into code.

Klassenbeschreibung

final class Attribute {
/* Konstanten */
const int TARGET_CLASS;
const int TARGET_FUNCTION;
const int TARGET_METHOD;
const int TARGET_PROPERTY;
const int TARGET_PARAMETER;
const int TARGET_ALL;
const int IS_REPEATABLE;
/* Eigenschaften */
public int $flags;
/* Methoden */
public __construct(int $flags = Attribute::TARGET_ALL)
}

Vordefinierte Konstanten

Attribute::TARGET_CLASS

Attribute::TARGET_FUNCTION

Attribute::TARGET_METHOD

Attribute::TARGET_PROPERTY

Attribute::TARGET_CLASS_CONSTANT

Attribute::TARGET_PARAMETER

Attribute::TARGET_ALL

Attribute::IS_REPEATABLE

Eigenschaften

flags

Siehe auch

Attributes overview

Inhaltsverzeichnis

add a note

User Contributed Notes

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