File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1527,8 +1527,9 @@ public function sCard($key)
15271527 * Removes and returns a random element from the set value at Key.
15281528 *
15291529 * @param string $key
1530+ * @param int $count [optional]
15301531 *
1531- * @return string|mixed|bool "popped" value
1532+ * @return string|mixed|array| bool "popped" values
15321533 * bool FALSE if set identified by key is empty or doesn't exist.
15331534 *
15341535 * @link https://redis.io/commands/spop
@@ -1539,9 +1540,19 @@ public function sCard($key)
15391540 * $redis->sAdd('key1' , 'set3'); // 'key1' => {'set3', 'set1', 'set2'}
15401541 * $redis->sPop('key1'); // 'set1', 'key1' => {'set3', 'set2'}
15411542 * $redis->sPop('key1'); // 'set3', 'key1' => {'set2'}
1543+ *
1544+ * // With count
1545+ * $redis->sAdd('key2', 'set1', 'set2', 'set3');
1546+ * var_dump( $redis->sPop('key2', 3) ); // Will return all members but in no particular order
1547+ *
1548+ * // array(3) {
1549+ * // [0]=> string(4) "set2"
1550+ * // [1]=> string(4) "set3"
1551+ * // [2]=> string(4) "set1"
1552+ * // }
15421553 * </pre>
15431554 */
1544- public function sPop ($ key )
1555+ public function sPop ($ key, $ count = 1 )
15451556 {
15461557 }
15471558
You can’t perform that action at this time.
0 commit comments