3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $holder; private $children; public function __construct($content = '', array $children = []) { $this->holder = $content; $this->setChildren($children); } public function setChildren(array $children) { $this->children = $children; foreach ($children as $child) { $child->setParent($this); } } } class Bar { private $holder; private $parent; public function __construct($content = '', Foo $parent = null) { $this->holder = $content; $this->setParent($parent); } public function setParent(Foo $parent = null) { $this->parent = $parent; } } $child0 = new Bar('child#0'); $child1 = new Bar('child#1'); //same $child2 = new Bar('child#0'); $child3 = new Bar('child#1'); $parent0 = new Foo('parent', [$child0, $child1]); $parent1 = new Foo('parent', [$child2, $child3]); //Fatal: var_dump(get_object_vars($parent0) == get_object_vars($parent1));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true)

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