3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParent { protected $x = "parent"; public function __construct() { $this->x = "parent - construct"; } } class MyChild extends MyParent { protected $x = "child"; public function __construct() { var_dump($this->x); $this->x = "child - construct"; var_dump($this->x); $closure = function () { var_dump($this->x); }; $closure = $closure->bindTo($this, parent::class); $closure(); } } new MyChild;
Output for git.master, git.master_jit, rfc.property-hooks
string(5) "child" string(17) "child - construct" string(17) "child - construct"

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