3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $count; public function __construct() { $this->count = 1; } public function addCount() { $this->count++; } } class Bar { private $foo; public function __construct() { $this->foo = new Foo; } public function getFoo() { return $this->foo; } } $bar = new Bar; $foo = $bar->getFoo(); $foo->addCount(); var_dump($bar->getFoo()); var_dump($foo);
Output for git.master, git.master_jit, rfc.property-hooks
object(Foo)#2 (1) { ["count":"Foo":private]=> int(2) } object(Foo)#2 (1) { ["count":"Foo":private]=> int(2) }

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