3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Some { public $one = '1'; } class Registry { public static $list = []; public static function set($key, $var) { self::$list[$key] = $var; } public static function get($key) { return self::$list[$key]; } } $product = new Some(); Registry::set('product', $product); var_dump(Registry::get('product'));

preferences:
57.45 ms | 402 KiB | 5 Q