Start · Sprachen · PHP · Referenz · ReflectionAttribute

ReflectionAttribute

Klasse

Repräsentiert ein PHP-Attribut — <code>getName()</code>, <code>getArguments()</code>, <code>newInstance()</code>.

seit PHP 8.0.0 Kategorie: oop

Signatur

class ReflectionAttribute

Beschreibung

Wird von ReflectionClass::getAttributes(), ReflectionMethod::getAttributes() usw. zurückgegeben.

Rückgabewert

Typ
ReflectionAttribute
Beschreibung
Instanz.

Beispiele

Basis

<?php

foreach ($reflectionClass->getAttributes() as $attr) {
    $instance = $attr->newInstance();
}