3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait FooTrait { } class Foo { use FooTrait; } function bar(FooTrait $foo): void { } bar(new Foo());
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: bar(): Argument #1 ($foo) must be of type FooTrait, Foo given, called in /in/Ifr2J on line 20 and defined in /in/Ifr2J:15 Stack trace: #0 /in/Ifr2J(20): bar(Object(Foo)) #1 {main} thrown in /in/Ifr2J on line 15
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:
31.38 ms | 405 KiB | 5 Q