3v4l.org

run code in 300+ PHP versions simultaneously
<?php class IsolatedTest { protected $closure; public function __construct($closure) { $this->closure = $closure; } public function __invoke() { call_user_func($this->closure); } } class Test { public function testing(callable $what) { return Closure::bind($what, $this, $this); } } $test = new IsolatedTest(function () { echo 'This can be forked and called.'; }); $more = (new Test)->testing($test); var_dump($more);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Closure::bind(): Argument #1 ($closure) must be of type Closure, IsolatedTest given in /in/usUfQ:22 Stack trace: #0 /in/usUfQ(22): Closure::bind(Object(IsolatedTest), Object(Test), Object(Test)) #1 /in/usUfQ(30): Test->testing(Object(IsolatedTest)) #2 {main} thrown in /in/usUfQ on line 22
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:
42.18 ms | 401 KiB | 8 Q