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

Skip to content

Commit abb0f6c

Browse files
Add details to the option doc block
1 parent 29e5cf0 commit abb0f6c

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

redis.stub.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,25 @@ class Redis {
155155
* @var int
156156
* @cvalue REDIS_OPT_PACK_IGNORE_NUMBERS
157157
*
158+
* When enabled, this option tells PhpRedis to ignore purely numeric values
159+
* when packing and unpacking data. This does not include numeric strings.
160+
* If you want numeric strings to be ignored, typecast them to an int or float.
161+
*
162+
* The primary purpose of this option is to make it more ergonomic when
163+
* setting keys that will later be incremented or decremented.
164+
*
165+
* Note: This option incurs a small performance penalty when reading data
166+
* because we have to see if the data is a string representation of an int
167+
* or float.
168+
*
169+
* @example
170+
* $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);
171+
* $redis->setOption(Redis::OPT_PACK_IGNORE_NUMBERS, true);
172+
*
173+
* $redis->set('answer', 32);
174+
*
175+
* var_dump($redis->incrBy('answer', 10)); // int(42)
176+
* var_dump($redis->get('answer')); // int(42)
158177
*/
159178
public const OPT_PACK_IGNORE_NUMBERS = UNKNOWN;
160179

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: 78283cf59cefb411c09adf7a0f0bd234c65327b3 */
2+
* Stub hash: 3c4051fdd9f860523bcd72aba260b1af823d1d9c */
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, 1, "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: 78283cf59cefb411c09adf7a0f0bd234c65327b3 */
2+
* Stub hash: 3c4051fdd9f860523bcd72aba260b1af823d1d9c */
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)