Skip to content

Commit c853365

Browse files
committed
Add PFCOUNT command
1 parent 2335632 commit c853365

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Redis.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3145,6 +3145,21 @@ public function scan( &$iterator, $pattern = null, $count = 0 ) {}
31453145
* @example $redis->pfAdd('key', array('elem1', 'elem2'))
31463146
*/
31473147
public function pfAdd( $key, array $elements ) {}
3148+
3149+
/**
3150+
* When called with a single key, returns the approximated cardinality computed by the HyperLogLog data
3151+
* structure stored at the specified variable, which is 0 if the variable does not exist.
3152+
* @param string|array $key
3153+
* @return int
3154+
* @link http://redis.io/commands/pfcount
3155+
* @example
3156+
* <pre>
3157+
* $redis->pfAdd('key1', array('elem1', 'elem2'));
3158+
* $redis->pfAdd('key2', array('elem3', 'elem2'));
3159+
* $redis->pfCount('key1'); // int(2)
3160+
* $redis->pfCount(array('key1', 'key2')); // int(3)
3161+
*/
3162+
public function pfCount( $key ) {}
31483163
}
31493164

31503165
class RedisException extends Exception {}

0 commit comments

Comments
 (0)