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());
Output for git.master, git.master_jit
Fatal error: Uncaught Error: Unknown named parameter $foo in /in/31a3W:14 Stack trace: #0 /in/31a3W(19): ReflectionAttribute->newInstance() #1 {main} thrown in /in/31a3W on line 14
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
27.82 ms | 405 KiB | 5 Q