PHP批量模糊清空Redis

<?php
$redis = new \Redis();
$redis->connect('127.0.0.1',6379);
$redis->setOption(\Redis::OPT_SCAN, \Redis::SCAN_RETRY);
while ($arr_keys = $redis->scan(NULL, "key_*", 5)) {
call_user_func_array([$redis, 'del'], $arr_keys);
echo var_export($arr_keys, true) . PHP_EOL;
}