diff --git a/memcache.install b/memcache.install
index 8e14dba..d69edca 100644
--- a/memcache.install
+++ b/memcache.install
@@ -6,6 +6,7 @@
  */
 
 define('MEMCACHE_PECL_RECOMMENDED', '3.0.6');
+define('MEMCACHE_PECL_PHP7_RECOMMENDED', '4.0.5');
 define('MEMCACHED_PECL_RECOMMENDED', '2.0.1');
 define('MEMCACHED_ASCII_AUTH_MINIMUM', '1.5.15');
 define('MEMCACHED_ASCII_AUTH_RECOMMENDED', '1.6.4');
@@ -112,7 +113,12 @@ function memcache_requirements($phase) {
       $extension = dmemcache_extension();
       if ($extension == 'Memcache') {
         $version = phpversion('memcache');
-        $recommended = MEMCACHE_PECL_RECOMMENDED;
+        if (version_compare(phpversion(), '7', '>=')) {
+          $recommended = MEMCACHE_PECL_PHP7_RECOMMENDED;
+        }
+        else {
+          $recommended = MEMCACHE_PECL_RECOMMENDED;
+        }
       }
       elseif ($extension == 'Memcached') {
         $version = phpversion('memcached');
@@ -256,7 +262,19 @@ function _memcache_statistics_link() {
 function _memcache_pecl_version_valid() {
   $extension = dmemcache_extension();
   if ($extension == 'Memcache') {
-    return version_compare(phpversion('memcache'), MEMCACHE_PECL_RECOMMENDED, '>=');
+    // The latest PECL Memcache releases are using a 4 digit version
+    // which version_compare doesn't support. At this time the 4th
+    // digit isn't important to us, we we just look at the first 3
+    // digits. If a future release requires 4 digit precision
+    // it will require a replacement for version_compare().
+    $full_version = phpversion('memcache');
+    $version = implode('.', array_slice(explode('.', $full_version), 0, 3));
+    if (version_compare(phpversion(), '7'. '>=')) {
+      return version_compare($version, MEMCACHE_PECL_PHP7_RECOMMENDED, '>=');
+    }
+    else {
+      return version_compare($version, MEMCACHE_PECL_RECOMMENDED, '>=');
+    }
   }
   elseif ($extension == 'Memcached') {
     return version_compare(phpversion('memcached'), MEMCACHED_PECL_RECOMMENDED, '>=');
