[ci skip] Fix #4562
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index 6dee1e8..836336d 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -295,7 +295,7 @@
 		{
 			$this->_memcached->close();
 		}
-		elseif ($this->_memcached instanceof Memcached)
+		elseif ($this->_memcached instanceof Memcached && method_exists($this->_memcached, 'quit'))
 		{
 			$this->_memcached->quit();
 		}