<?php declare(strict_types = 1); namespace X; #[\Attribute] class MyAttr { public function __construct(private string $n) {} } #[\AllowDynamicProperties] #[MyAttr('foo')] class Cl { } print_r(array_map(function (\ReflectionAttribute $v) { return class_exists($v->getName(), false) ? $v->newInstance() : $v; }, (new \ReflectionClass(Cl::class))->getAttributes()));
You have javascript disabled. You will not be able to edit any code.