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

Skip to content

Commit e0b24be

Browse files
Documentation: Add a BRPOPLPUSH example block
[skip ci]
1 parent a2b0c86 commit e0b24be

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

redis.stub.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,32 @@ public function role(): mixed;
920920
*
921921
* @return Redis|string|false The popped element or false if the source key was empty.
922922
*
923+
* <code>
924+
* <?php
925+
* $redis = new Redis(['host' => 'localhost']);
926+
*
927+
* $redis->pipeline()
928+
* ->del('list1', 'list2')
929+
* ->rpush('list1', 'list1-1', 'list1-2')
930+
* ->rpush('list2', 'list2-1', 'list2-2')
931+
* ->exec();
932+
*
933+
* var_dump($redis->rpoplpush('list2', 'list1'));
934+
* var_dump($redis->lrange('list1', 0, -1));
935+
*
936+
* // --- OUTPUT ---
937+
* // string(7) "list2-2"
938+
* //
939+
* // array(3) {
940+
* // [0]=>
941+
* // string(7) "list2-2"
942+
* // [1]=>
943+
* // string(7) "list1-1"
944+
* // [2]=>
945+
* // string(7) "list1-2"
946+
* // }
947+
* ?>
948+
* </code>
923949
*/
924950
public function rpoplpush(string $srckey, string $dstkey): Redis|string|false;
925951

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: 3c2e612a6892a8ae2ac363336c462e24a1333050 */
2+
* Stub hash: 63dd54d205675ceed36354c9b880e6afc7a0604e */
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: 3c2e612a6892a8ae2ac363336c462e24a1333050 */
2+
* Stub hash: 63dd54d205675ceed36354c9b880e6afc7a0604e */
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)