3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass; $b = $a; $a->foo = 'bar'; var_dump($b); /* Notice at this point, that $a and $b are, * indeed sharing the same object instance. * This is their reference-like behavior at work. */ $a = 'baz'; var_dump($a); var_dump($b); /* Notice now, that $b is still that original object. * Had it been an actual reference with $a, * it would have changed to a simple string as well. */ ?>
Output for git.master, git.master_jit, rfc.property-hooks
object(stdClass)#1 (1) { ["foo"]=> string(3) "bar" } string(3) "baz" object(stdClass)#1 (1) { ["foo"]=> string(3) "bar" }

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