<?php
$reflection = new ReflectionClassConstant(Child::class, 'NAME');
foreach ($reflection->getAttributes() as $attribute) {
$attribute->newInstance(); // May throw if invalid
}
When any attribute applied to the same target (other than
DelayedTargetValidation itself) is instantiated via reflection using
ReflectionAttribute::newInstance(),
target validation is performed and an exception may be thrown if the attribute
is used on an unsupported target.