3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $id; } class Foo2 { public $id; public function __construct($id) { $this->id = $id; } } class Foo3 { protected $id; public function __construct($id) { $this->id = $id; } public function getId() { return $this->id; } } class Foo4 { private $id; public function __construct($id) { $this->id = $id; } public function __get($key) { echo $key; return $this->id; } } $data = new Foo; $data->id = 10; echo $data->id; $data2 = new Foo2(10); echo $data2->id; $data3 = new Foo3(10); echo $data3->getId(); $data4 = new Foo4(10); echo $data4->id;
Output for git.master, git.master_jit, rfc.property-hooks
101010id10

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