3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class HookWithDependency { public function __construct( public readonly string $name, public readonly ?string $type = 'module', ) { } } #[HookWithDependency(name: 'bar')] class Example {} $reflectionClass = new \ReflectionClass(Example::class); var_dump($reflectionClass->getAttributes()[0]->newInstance());
Output for git.master, git.master_jit
object(HookWithDependency)#3 (2) { ["name"]=> string(3) "bar" ["type"]=> string(6) "module" }

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:
47.2 ms | 848 KiB | 4 Q