3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute] class x {} class y extends x {} $ref = new \ReflectionFunction(#[x, y] function () { }); try { $ref->getAttributes()[0]->newInstance(); $ref->getAttributes()[1]->newInstance(); } catch (\Error $e) { var_dump('Error : ', $e->getMessage()); } ?>
Output for rfc.property-hooks, git.master_jit, git.master
string(8) "Error : " string(54) "Attempting to use non-attribute class "y" as attribute"

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:
45.91 ms | 2732 KiB | 4 Q