3v4l.org

run code in 300+ PHP versions simultaneously
<?php // declare(strict_types=1); namespace Test\Biz; //error_reporting(-1); class Foo { public function bar($value) { if (\is_callable($value)) { return $this->baz($value); } } public function baz(callable $callable) { return $callable; } } function demonstrate2(callable $callable) { return $callable; } echo (new Foo())->bar('\Test\Biz\Foo::bar'); demonstrate2('\Test\Biz\Foo::bar');
Output for git.master, git.master_jit, rfc.property-hooks
\Test\Biz\Foo::bar Fatal error: Uncaught TypeError: Test\Biz\demonstrate2(): Argument #1 ($callable) must be of type callable, string given, called in /in/XMiVr on line 29 and defined in /in/XMiVr:23 Stack trace: #0 /in/XMiVr(29): Test\Biz\demonstrate2('\\Test\\Biz\\Foo::...') #1 {main} thrown in /in/XMiVr on line 23
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:
24.58 ms | 405 KiB | 5 Q