3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public $bar = 1; function __construct($a) { $this->bar = $a; } } function foo1(&$test) { $test = new X(12); } function foo2($test){ $test = new X(12); } $n = new X(0); foo2($n); var_dump($n); foo1($n); var_dump($n);
Output for git.master, git.master_jit, rfc.property-hooks
object(X)#1 (1) { ["bar"]=> int(0) } object(X)#2 (1) { ["bar"]=> int(12) }

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:
28.15 ms | 405 KiB | 5 Q