<?php #[Attribute] class Attr { public function __construct(public int $i) {} } #[Attr(i: 1)] #[NonExistentAttr(somevalue: 'string')] class C {} $refl = new ReflectionClass('C'); $attrs = $refl->getAttributes(); print_r($attrs); print_r($attrs[0]->newInstance()); print_r($attrs[1]->newInstance());
You have javascript disabled. You will not be able to edit any code.