3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class Item{} /** * @method static Item OAK_SIGN() */ class VanillaItems{ /** * @param mixed[] $args */ public static function __callStatic(string $name, array $args) : mixed{ if($name === "OAK_SIGN"){ return new Item(); } throw new \AssertionError("No such @method"); } } class HelloWorld { public function sayHello(): void { $closure = VanillaItems::OAK_SIGN(...); var_dump($closure()); } } (new HelloWorld)->sayHello();
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
object(Item)#3 (0) { }

preferences:
158.89 ms | 1400 KiB | 58 Q