3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $foo = 42; public function __get($name) { echo "__get($name)\n"; return $this->bar($name); } public function bar($name) { echo "bar($name)\n"; return $this->foo; } } $foo = new Foo; echo "Calling via accessor:\n"; var_dump($foo->foo); echo "Calling method directly:\n"; var_dump($foo->bar('foo'));
Output for git.master, git.master_jit, rfc.property-hooks
Calling via accessor: __get(foo) bar(foo) int(42) Calling method directly: bar(foo) int(42)

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