class Session
{
private $session;
public function __construct(&$session = null)
{
$this->session = $session ;
}
public function get($key) // TODO string or array
{
return $this-session[$key] ?? null;
}
public function set($key, $value): void
{
$this-session[$key] = $value;
}
}
$instanse = new Session($_SESSION);
$this->session = $session ;
$this->session = &$session ;