<?php #[Attribute] class A {} class B {} #[A] function a(): void {} #[B] function b(): void {} $a = new ReflectionFunction('a'); $b = new ReflectionFunction('b'); foreach([$a, $b] as $reflection) { $attributes = $reflection->getAttributes(); foreach ($attributes as $attribute) { var_dump($attribute->getName()); var_dump($attribute->getArguments()); var_dump($attribute->newInstance()); } }
You have javascript disabled. You will not be able to edit any code.