diff options
author | michael-grunder <michael.grunder@gmail.com> | 2022-10-27 01:07:42 +0300 |
---|---|---|
committer | Michael Grunder <michael.grunder@gmail.com> | 2022-10-27 01:20:31 +0300 |
commit | 375d093d9482dfd794b5f6fb230b689f0540bbc9 (patch) | |
tree | e36471e12a523b00011c2f2ceb8aa2115091b0e4 | |
parent | 6982941b0b25c4897a5910558f8e4ee2119322ca (diff) |
Documentation: BITPOS and BITCOUNT
-rw-r--r-- | redis.stub.php | 42 | ||||
-rw-r--r-- | redis_arginfo.h | 2 | ||||
-rw-r--r-- | redis_legacy_arginfo.h | 2 |
3 files changed, 32 insertions, 14 deletions
diff --git a/redis.stub.php b/redis.stub.php index 590ef953..37f3bc8d 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -158,23 +158,41 @@ class Redis { public function bgrewriteaof(): Redis|bool; - + /** + * Count the number of set bits in a Redis string. + * + * @see https://https://redis.io/commands/bitcount/ + * + * @param string $key The key in question (must be a string key) + * @param int $start The index where Redis should start counting. If ommitted it + * defaults to zero, which means the start of the string. + * @param int $end The index where Redis should stop counting. If ommitted it + * defaults to -1, meaning the very end of the string. + * + * @param bool $bybit Whether or not Redis should treat $start and $end as bit + * positions, rather than bytes. + * + * @return Redis|int|false The number of bits set in the requested range. + * + */ public function bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false; public function bitop(string $operation, string $deskey, string $srckey, string ...$other_keys): Redis|int|false; /** - Return the position of the first bit set to 0 or 1 in a string. - - @see https://https://redis.io/commands/bitpos/ - - @param string $key The key to check (must be a string) - @param bool $bit Whether to look for an unset (0) or set (1) bit. - @param int $start Where in the string to start looking. - @param int $end Where in the string to stop looking. - @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start - was 0 and end was 2, Redis would only search the first two bits. - */ + * Return the position of the first bit set to 0 or 1 in a string. + * + * @see https://https://redis.io/commands/bitpos/ + * + * @param string $key The key to check (must be a string) + * @param bool $bit Whether to look for an unset (0) or set (1) bit. + * @param int $start Where in the string to start looking. + * @param int $end Where in the string to stop looking. + * @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start + * was 0 and end was 2, Redis would only search the first two bits. + * + * @return Redis|int|false The position of the first set or unset bit. + **/ public function bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false; public function blPop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args): Redis|array|null|false; diff --git a/redis_arginfo.h b/redis_arginfo.h index 6fd5fef1..4e98b1f5 100644 --- a/redis_arginfo.h +++ b/redis_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4e21096b9ab449cbf12dd9c8a85a875786a9836a */ + * Stub hash: 21ca57fa960dd8afd88a830b1628e229e831476d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null") diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index 718c18da..adda8981 100644 --- a/redis_legacy_arginfo.h +++ b/redis_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4e21096b9ab449cbf12dd9c8a85a875786a9836a */ + * Stub hash: 21ca57fa960dd8afd88a830b1628e229e831476d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) |