3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class HookDependsOn { public function __construct( public readonly ?string $module = NULL, ) { } } #[HookDependsOn(foo: 'bar')] class Example {} $reflectionClass = new \ReflectionClass(Example::class); var_dump($reflectionClass->getAttributes()[0]->newInstance());

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
156.99 ms | 1473 KiB | 9 Q