diff --git a/redis.stub.php b/redis.stub.php index 9a41768..8d0b765 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -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; diff --git a/redis_arginfo.h b/redis_arginfo.h index fb9cf97..072e1fb 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: 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") diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index c382766..27f0c44 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: 78283cf59cefb411c09adf7a0f0bd234c65327b3 */ + * Stub hash: 3c4051fdd9f860523bcd72aba260b1af823d1d9c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options)