Skip to content

Commit 6e9f6d8

Browse files
authored
Fixed in the example the use of SCAN function
The example of using SCAN did not work properly if $pattern was used. If we do not test the return is FALSE (end of scan) and we used $pattern (Redis MATCH option) the scan function can return empty lists because of the way it works, but we still have to keep going through the list until the function returns FALSE. More information on this feature of Redis in the doc with the MATCH option: https://redis.io/commands/scan#the-match-option
1 parent 324ae44 commit 6e9f6d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Redis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4548,7 +4548,7 @@ public function time()
45484548
* @example
45494549
* <pre>
45504550
* $iterator = null;
4551-
* while($keys = $redis->scan($iterator)) {
4551+
* while(false !== ($keys = $redis->scan($iterator))) {
45524552
* foreach($keys as $key) {
45534553
* echo $key . PHP_EOL;
45544554
* }

0 commit comments

Comments
 (0)