3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private $candy = 'sweet'; } class Baz { public function __invoke(Bar $bar) { return $bar->candy; } } $bar = new Bar; $baz = new Baz; var_dump(Closure::bind($baz, null, Bar::class)->__invoke($bar));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Closure::bind(): Argument #1 ($closure) must be of type Closure, Baz given in /in/YLvfZ:9 Stack trace: #0 /in/YLvfZ(9): Closure::bind(Object(Baz), NULL, 'Bar') #1 {main} thrown in /in/YLvfZ on line 9
Process exited with code 255.

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:
41.31 ms | 1461 KiB | 4 Q