3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A {} class B {} class C {} class Test { public function __construct( public A $foo, public B $bar, public ?C $baz = null ) { $this->baz = $baz ?? new C; } } $test = new Test(new A, new B); var_dump($test);
Output for rfc.property-hooks, git.master, git.master_jit
object(Test)#1 (3) { ["foo"]=> object(A)#2 (0) { } ["bar"]=> object(B)#3 (0) { } ["baz"]=> object(C)#4 (0) { } }

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:
51.92 ms | 1081 KiB | 4 Q