3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ObjectWithReferences { protected $var1; protected $var2; public function __construct() { $this->var1 = new StdClass(); $this->var2 = $this->var1; } } class WrapperObject { static $tempstorage; protected $obj; public function setObject($obj) { $this->obj = $obj; } public function getObject() { return $this->obj; } } $owr = new ObjectWithReferences(); $wrapper = new WrapperObject(); $wrapper->setObject($owr); var_dump($wrapper->getObject()); $wrapper = unserialize(serialize($wrapper)); var_dump($wrapper->getObject());
Output for git.master, git.master_jit, rfc.property-hooks
object(ObjectWithReferences)#1 (2) { ["var1":protected]=> object(stdClass)#2 (0) { } ["var2":protected]=> object(stdClass)#2 (0) { } } object(ObjectWithReferences)#5 (2) { ["var1":protected]=> object(stdClass)#6 (0) { } ["var2":protected]=> object(stdClass)#6 (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:
43.62 ms | 402 KiB | 8 Q