ReflectionAttribute::newInstance
(PHP 8)
ReflectionAttribute::newInstance — Instantiates the attribute class represented by this ReflectionAttribute class and arguments
Beschreibung
public function ReflectionAttribute::newInstance():
object
Parameter-Liste
Diese Funktion besitzt keine Parameter.
Rückgabewerte
New instance of the attribute.
Fehler/Exceptions
Throws an Error if the attribute class cannot
be loaded, or if the class is not declared with
#[Attribute].
Throws an Error if the attribute is applied
to a target it cannot be used on, or if it is applied more than once and is
not declared with Attribute::IS_REPEATABLE. For
internal attributes, target validation happens here instead of at compile
time when the declaration uses
#[\DelayedTargetValidation].
Errors and exceptions thrown by the attribute constructor are propagated.