3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $name = 'john'; function say() { echo $this->name; } } class Foo2 extends Foo { private $name = 'lisa'; } Closure::fromCallable([new Foo2(), 'say'])->call(new Foo()); // good Closure::fromCallable([new Foo(), 'say'])->call(new Foo2()); // bad
Output for git.master_jit, git.master, rfc.property-hooks
john Warning: Cannot rebind scope of closure created from method in /in/jM1rt on line 20

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