3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute] class SomeAttr {} /** * Class comment */ #[SomeAttr] class SomeClass { /** * Property comment */ #[SomeAttr] private string $someProperty; /** * Method comment */ #[SomeAttr] public function someMethod(string $someParam): void { } } $reflection = new ReflectionClass(SomeClass::class); echo (string) $reflection; echo (string) $reflection->getMethod('someMethod'); echo (string) $reflection->getProperty('someProperty'); echo $reflection->getMethod('someMethod')->getAttributes()[0];

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
150.74 ms | 2140 KiB | 8 Q