@@ -1044,22 +1044,32 @@ public function sPop( $key ) {}
10441044
10451045
10461046 /**
1047- * Returns a random element from the set value at Key, without removing it.
1047+ * Returns a random element(s) from the set value at Key, without removing it.
10481048 *
1049- * @param string $key
1050- * @return string value from the set
1051- * bool FALSE if set identified by key is empty or doesn't exist.
1049+ * @param string $key
1050+ * @param int $count [optional]
1051+ * @return string|array value(s) from the set
1052+ * bool FALSE if set identified by key is empty or doesn't exist and count argument isn't passed.
10521053 * @link http://redis.io/commands/srandmember
10531054 * @example
10541055 * <pre>
1055- * $redis->sAdd('key1' , 'set1');
1056- * $redis->sAdd('key1' , 'set2');
1057- * $redis->sAdd('key1' , 'set3'); // 'key1' => {'set3', 'set1', 'set2'}
1058- * $redis->sRandMember('key1'); // 'set1', 'key1' => {'set3', 'set1', 'set2'}
1059- * $redis->sRandMember('key1'); // 'set3', 'key1' => {'set3', 'set1', 'set2'}
1056+ * $redis->sAdd('key1' , 'one');
1057+ * $redis->sAdd('key1' , 'two');
1058+ * $redis->sAdd('key1' , 'three'); // 'key1' => {'one', 'two', 'three'}
1059+ *
1060+ * var_dump( $redis->sRandMember('key1') ); // 'key1' => {'one', 'two', 'three'}
1061+ *
1062+ * // string(5) "three"
1063+ *
1064+ * var_dump( $redis->sRandMember('key1', 2) ); // 'key1' => {'one', 'two', 'three'}
1065+ *
1066+ * // array(2) {
1067+ * // [0]=> string(2) "one"
1068+ * // [1]=> string(2) "three"
1069+ * // }
10601070 * </pre>
10611071 */
1062- public function sRandMember ( $ key ) {}
1072+ public function sRandMember ( $ key, $ count = null ) {}
10631073
10641074 /**
10651075 * Returns the members of a set resulting from the intersection of all the sets
0 commit comments