3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __set($name, $value) { echo "__set($name)\n"; return $this->bar($name, $value); } public function bar($name, $value) { echo "bar($name)\n"; $this->foo = $value; } } echo "Calling via accessor:\n"; $foo = new Foo; $foo->foo = 42; echo "Calling method directly:\n"; $foo = new Foo; $foo->bar('foo', 42);
Output for git.master, git.master_jit, rfc.property-hooks
Calling via accessor: __set(foo) bar(foo) Deprecated: Creation of dynamic property Foo::$foo is deprecated in /in/dpYOj on line 11 Calling method directly: bar(foo) __set(foo) bar(foo) Deprecated: Creation of dynamic property Foo::$foo is deprecated in /in/dpYOj on line 11

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