src/Memcache.php
static public function isConnected(\Memcache $Memcache){

		/** @noinspection PhpVoidFunctionResultUsedInspection */
		$version = @$Memcache->getVersion();

		if($version === false){

			return false;
		}

		return true;
	}
static public function isConnected(\Memcache $Memcache){

		/** @noinspection PhpVoidFunctionResultUsedInspection */
		$version = @$Memcache->getVersion();

		if($version === false){

			return false;
		}

		return true;
	}
static public function isConnected ( \ Memcache $ Memcache ) { /** @noinspection PhpVoidFunctionResultUsedInspection */ $ version = @ $ Memcache -> getVersion ( ) ; if ( $ version === false ) { return false ; } return true ; }
Check if the provided Memcache-instance is connected.

<p>As there is not built-in functionality in the PHP Memcache class to
check if an instance is connected we use a simple workaround by querying
the version of the (connected) Memcache server. If we fail to get a
version it's (relatively) safe to assume the instance is not
connected.</p>

@param \Memcache $Memcache
@return bool
Check if the provided Memcache - instance is connected .