Add details to the option doc block

This commit is contained in:
michael-grunder
2025-02-05 13:40:19 -08:00
committed by Michael Grunder
parent 29e5cf0d8c
commit abb0f6ccc8
3 changed files with 21 additions and 2 deletions

View File

@@ -155,6 +155,25 @@ class Redis {
* @var int
* @cvalue REDIS_OPT_PACK_IGNORE_NUMBERS
*
* When enabled, this option tells PhpRedis to ignore purely numeric values
* when packing and unpacking data. This does not include numeric strings.
* If you want numeric strings to be ignored, typecast them to an int or float.
*
* The primary purpose of this option is to make it more ergonomic when
* setting keys that will later be incremented or decremented.
*
* Note: This option incurs a small performance penalty when reading data
* because we have to see if the data is a string representation of an int
* or float.
*
* @example
* $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);
* $redis->setOption(Redis::OPT_PACK_IGNORE_NUMBERS, true);
*
* $redis->set('answer', 32);
*
* var_dump($redis->incrBy('answer', 10)); // int(42)
* var_dump($redis->get('answer')); // int(42)
*/
public const OPT_PACK_IGNORE_NUMBERS = UNKNOWN;

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 78283cf59cefb411c09adf7a0f0bd234c65327b3 */
* Stub hash: 3c4051fdd9f860523bcd72aba260b1af823d1d9c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 78283cf59cefb411c09adf7a0f0bd234c65327b3 */
* Stub hash: 3c4051fdd9f860523bcd72aba260b1af823d1d9c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
ZEND_ARG_INFO(0, options)