3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __construct( public $callable = static function (): void {} { // <----- BRACES OVERFLOW 🙈 set($value) { if (!is_callable($value)) { throw new \InvalidArgumentException('This is not callable, bro.'); } $this->callable = $value; } } ) {} } $foo = new Foo(static function (): void { echo 'TEST'; }); ($foo->callable)(); $foo->callable = new \stdClass();
Output for git.master, git.master_jit
TEST Fatal error: Uncaught InvalidArgumentException: This is not callable, bro. in /in/3inE8:8 Stack trace: #0 /in/3inE8(21): Foo->$callable::set(Object(stdClass)) #1 {main} thrown in /in/3inE8 on line 8
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:
49.14 ms | 498 KiB | 3 Q