src/mako/session/Session.php
public function getAndPut(string $key, $value, $default = null)
	{
		$storedValue = $this->get($key, $default);

		$this->put($key, $value);

		return $storedValue;
	}
public function getAndPut(string $key, $value, $default = null)
	{
		$storedValue = $this->get($key, $default);

		$this->put($key, $value);

		return $storedValue;
	}
public function getAndPut ( string $ key , $ value , $ default = null ) { $ storedValue = $ this -> get ( $ key , $ default ) ; $ this -> put ( $ key , $ value ) ; return $ storedValue ; }
Gets a value from the session and replaces it.

@param  string $key     Session key
@param  mixed  $value   Session data
@param  mixed  $default Default value
@return mixed
Gets a value from the session and replaces it .