3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { #[MyAttr(msg: __METHOD__)] public function doFoo(#[MyAttr(msg: __METHOD__)] $param = __METHOD__): void { var_dump($param); var_dump(__METHOD__); } } $f = new Foo(); $f->doFoo(); $r = new ReflectionClass(Foo::class); $m = $r->getMethod('doFoo'); var_dump($m->getAttributes()[0]->getArguments()); $p = $m->getParameters()[0]; var_dump($p->getAttributes()[0]->getArguments());
Output for rfc.property-hooks, git.master, git.master_jit
string(10) "Foo::doFoo" string(10) "Foo::doFoo" array(1) { ["msg"]=> string(10) "Foo::doFoo" } array(1) { ["msg"]=> string(10) "Foo::doFoo" }

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.33 ms | 2764 KiB | 4 Q