3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyNode { public $name; public $children = array(); public $parent; public function __construct(string $name, $parent) { echo "in constructor\n"; $this->name = $name; echo "name: " . $this->name . ".\n"; $this->parent = $parent; echo "parent: " . $this->parent . ".\n"; } public function __toString() { return $this->name; } } $RootNode = new MyNode("Root", null); echo "done root x\n"; $ChildNode = new MyNode("Child1", $RootNode); echo "done child\n";
Output for git.master, git.master_jit, rfc.property-hooks
in constructor name: Root. parent: . done root x in constructor name: Child1. parent: Root. done child

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