Redis::hmGet()返回只有数值索引的数组
$redis->del('h');
$redis->hSet('h', 'field1', 'value1');
$redis->hSet('h', 'field2', 'value2');
$redis->hMGet('h', ['field1', 'field2', 'field3']理想状态下输出应该是
array (
'field1' => 'value1',
'field2' => 'value2',
'field3' => null
)
但实际却是
array (
0 => 'value1',
1 => 'value2',
2 => null
)
看了下源码,我自行用array_combine处理吧