3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { var $foo = 1; } $a = new A; $b = $a; // $a and $b are copies of the same identifier // ($a) = ($b) = <id> $b->foo = 2; echo '$a->foo' . $a->foo . PHP_EOL; $c = new A; $d = &$c; // $c and $d are references // ($c,$d) = <id> $d->foo = 2; echo '$c->foo' . $c->foo . PHP_EOL; $e = new A; function foo($obj) { // ($obj) = ($e) = <id> $obj->foo = 2; } foo($e); echo '$e->foo' . $e->foo . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
$a->foo2 $c->foo2 $e->foo2

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:
52.21 ms | 401 KiB | 8 Q