has($name)) { $_SESSION[$name] = []; } return array_pop($_SESSION[$name]); } public function staticShift($name, $item) { if(!!$this->has($name)) { $_SESSION[$name] = []; } return array_shift($_SESSION[$name]); } public function staticUnshift($name, $item) { if(!!$this->has($name)) { $_SESSION[$name] = []; } $_SESSION[$name] = [ $item, ...$_SESSION[$name] ]; } public function staticMerge($name, $item) { if(!!$this->has($name)) { $_SESSION[$name] = []; } $_SESSION[$name] = [ ...$_SESSION[$name], ...$item ]; } public function staticPath($path) { session_save_path($path); } public function staticStatus() { switch(session_status()) { case PHP_SESSION_ACTIVE:{ return Session::$active = true; } default:{ return Session::$active = false; } } } public function staticInit() { if(!Session::$ready) { $this->__contruct(); } if(!$this->staticStatus()) { $this->staticStart(); } } }; define("session", new Session(), false);