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();

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.10.0340.00717.39
8.3.140.0200.00616.50
8.3.50.0080.01016.77

preferences:
47.9 ms | 497 KiB | 4 Q