3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct( public readonly array $bar, ) {} } $ref = 42; $bar = [&$ref]; $foo = new Foo($bar); var_dump($foo); $ref = 43; var_dump($foo);
Output for git.master, git.master_jit
object(Foo)#1 (1) { ["bar"]=> array(1) { [0]=> &int(42) } } object(Foo)#1 (1) { ["bar"]=> array(1) { [0]=> &int(43) } }

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:
145.61 ms | 1394 KiB | 9 Q