public function spop($key, $count = 1)
    {
        $this->init();
        if ($count == 1 || $count === null) {
            $result = $this->driver->spop($key);
            return $this->convertFalseToNull($result);
        }

        $members = [];
        for ($i = 0; $i < $count; ++$i) {
            $member = $this->driver->spop($key);
            if (!$member) {
                break;
            }
            $members[] = $member;
        }
        return empty($members) ? null : $members;
    }
public function spop($key, $count = 1)
    {
        $this->init();
        if ($count == 1 || $count === null) {
            $result = $this->driver->spop($key);
            return $this->convertFalseToNull($result);
        }

        $members = [];
        for ($i = 0; $i < $count; ++$i) {
            $member = $this->driver->spop($key);
            if (!$member) {
                break;
            }
            $members[] = $member;
        }
        return empty($members) ? null : $members;
    }
public function spop ( $ key , $ count = 1 ) { $ this -> init ( ) ; if ( $ count == 1 || $ count === null ) { $ result = $ this -> driver -> spop ( $ key ) ; return $ this -> convertFalseToNull ( $ result ) ; } $ members = [ ] ; for ( $ i = 0 ; $ i < $ count ; ++ $ i ) { $ member = $ this -> driver -> spop ( $ key ) ; if ( ! $ member ) { break ; } $ members [ ] = $ member ; } return empty ( $ members ) ? null : $ members ; }
Remove and return one or multiple random members from a set
@param string $key
@param int $count number of members
@return mixed string if $count is null or 1 and $key exists, array if $count > 1 and $key exists, null if $key doesn't exist
Remove and return one or multiple random members from a set