Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 375d093

Browse files
Documentation: BITPOS and BITCOUNT
1 parent 6982941 commit 375d093

3 files changed

Lines changed: 32 additions & 14 deletions

File tree

redis.stub.php

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,41 @@ public function bgSave(): Redis|bool;
158158

159159
public function bgrewriteaof(): Redis|bool;
160160

161-
161+
/**
162+
* Count the number of set bits in a Redis string.
163+
*
164+
* @see https://https://redis.io/commands/bitcount/
165+
*
166+
* @param string $key The key in question (must be a string key)
167+
* @param int $start The index where Redis should start counting. If ommitted it
168+
* defaults to zero, which means the start of the string.
169+
* @param int $end The index where Redis should stop counting. If ommitted it
170+
* defaults to -1, meaning the very end of the string.
171+
*
172+
* @param bool $bybit Whether or not Redis should treat $start and $end as bit
173+
* positions, rather than bytes.
174+
*
175+
* @return Redis|int|false The number of bits set in the requested range.
176+
*
177+
*/
162178
public function bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false;
163179

164180
public function bitop(string $operation, string $deskey, string $srckey, string ...$other_keys): Redis|int|false;
165181

166182
/**
167-
Return the position of the first bit set to 0 or 1 in a string.
168-
169-
@see https://https://redis.io/commands/bitpos/
170-
171-
@param string $key The key to check (must be a string)
172-
@param bool $bit Whether to look for an unset (0) or set (1) bit.
173-
@param int $start Where in the string to start looking.
174-
@param int $end Where in the string to stop looking.
175-
@param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start
176-
was 0 and end was 2, Redis would only search the first two bits.
177-
*/
183+
* Return the position of the first bit set to 0 or 1 in a string.
184+
*
185+
* @see https://https://redis.io/commands/bitpos/
186+
*
187+
* @param string $key The key to check (must be a string)
188+
* @param bool $bit Whether to look for an unset (0) or set (1) bit.
189+
* @param int $start Where in the string to start looking.
190+
* @param int $end Where in the string to stop looking.
191+
* @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start
192+
* was 0 and end was 2, Redis would only search the first two bits.
193+
*
194+
* @return Redis|int|false The position of the first set or unset bit.
195+
**/
178196
public function bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false;
179197

180198
public function blPop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args): Redis|array|null|false;

redis_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 4e21096b9ab449cbf12dd9c8a85a875786a9836a */
2+
* Stub hash: 21ca57fa960dd8afd88a830b1628e229e831476d */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null")

redis_legacy_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 4e21096b9ab449cbf12dd9c8a85a875786a9836a */
2+
* Stub hash: 21ca57fa960dd8afd88a830b1628e229e831476d */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_INFO(0, options)

0 commit comments

Comments
 (0)