3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar{} class Baz{} class Foo { public function __construct(Bar ...$bars) { var_dump($bars); } } $foo = new Foo(...[new Bar, new Bar]); $foo = new Foo(...[new Bar, new Bar, new Baz]);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> object(Bar)#2 (0) { } [1]=> object(Bar)#3 (0) { } } Fatal error: Uncaught TypeError: Foo::__construct(): Argument #3 must be of type Bar, Baz given, called in /in/SDRZ0 on line 16 and defined in /in/SDRZ0:9 Stack trace: #0 /in/SDRZ0(16): Foo->__construct(Object(Bar), Object(Bar), Object(Baz)) #1 {main} thrown in /in/SDRZ0 on line 9
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:
94.51 ms | 1723 KiB | 4 Q