3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { 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) Warning: Undefined property: Foo::$foo in /in/2nDZS on line 11 NULL Calling method directly: bar(foo) __get(foo) bar(foo) Warning: Undefined property: Foo::$foo in /in/2nDZS on line 11 NULL

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:
27.96 ms | 406 KiB | 5 Q