3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Demo { public static $cache; static function test($id, $val) { return self::$cache[$id] = $val; } } echo Demo::test(1, 1); echo Demo::test(2, 2); var_dump(Demo::$cache);

preferences:
38.95 ms | 402 KiB | 5 Q