Skip to content

Commit 9e4c514

Browse files
committed
Issue #2728427 by lussoluca, GroovyCarrot, MiSc, damiankloip: Add compatibility with PHP 7
1 parent bf772cf commit 9e4c514

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/DrupalMemcached.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ public function getMulti(array $keys) {
7676
$full_keys[$cid] = $full_key;
7777
}
7878

79-
$cas_tokens = NULL;
80-
$results = $this->memcache->getMulti($full_keys, $cas_tokens, \Memcached::GET_PRESERVE_ORDER);
79+
if (PHP_MAJOR_VERSION === 7) {
80+
$results = $this->memcache->getMulti($full_keys, \Memcached::GET_PRESERVE_ORDER);
81+
} else {
82+
$cas_tokens = NULL;
83+
$results = $this->memcache->getMulti($full_keys, $cas_tokens, \Memcached::GET_PRESERVE_ORDER);
84+
}
8185

8286
// If $results is FALSE, convert it to an empty array.
8387
if (!$results) {

0 commit comments

Comments
 (0)