3v4l.org

run code in 300+ PHP versions simultaneously
<?php #️[Foo] #️⃣[as] #[Baz] class Qux { } $reflection = new ReflectionClass(Qux::class); var_dump($reflection->getAttributes());
Output for 8.4.1 - 8.4.3
array(1) { [0]=> object(ReflectionAttribute)#2 (1) { ["name"]=> string(3) "Baz" } }
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.16
array(1) { [0]=> object(ReflectionAttribute)#2 (0) { } }

preferences:
48.3 ms | 407 KiB | 5 Q