我正在尝试调用此类函数:
public function scan(&$Iterator, $pattern = null, $count = null)
{
return $this->__call('scan', array(&$Iterator, $pattern, $count));
}
在我班上:
$itScan = NULL;
while($arr_keys = $this->redisClient->scan($itScan, '', 10000)) {
foreach($arr_keys as $str_key) {
echo "Here is a key: $str_key\n";
}
}
我了解这与&指针有关,但是我不知道该从谁内部调用它。
谢谢!
答案 0 :(得分:0)
这是迭代结果的正确方法:
$i = null;
$allResults = [];
do {
$someResults = $redis->scan($i, "*", 10000);
if (!empty($someResults)) {
$allKeys = array_merge($allKeys, $someResults);
}
}
while ($i);