Skip to content

Commit 3d08f29

Browse files
committed
Fix problem related to issue 91.
1 parent ed61e0f commit 3d08f29

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

redis.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4203,6 +4203,7 @@ PHP_METHOD(Redis, hMget) {
42034203
/* save context */
42044204
MAKE_STD_ZVAL(z_keys[i]);
42054205
*z_keys[i] = **data;
4206+
convert_to_string(z_keys[i]);
42064207
zval_copy_ctor(z_keys[i]);
42074208

42084209
i++;

tests/TestRedis.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,9 @@ public function testHashes() {
18521852
$this->assertTrue(array('x' => '123', 'y' => '456') === $this->redis->hMget('h', array('x', 'y')));
18531853
$this->assertTrue(array('z' => 'abc') === $this->redis->hMget('h', array('z')));
18541854
$this->assertTrue(array('x' => '123', 't' => FALSE, 'y' => '456') === $this->redis->hMget('h', array('x', 't', 'y')));
1855+
$this->assertFalse(array(123 => 'x') === $this->redis->hMget('h', array(123)));
1856+
$this->assertTrue(array(123 => FALSE) === $this->redis->hMget('h', array(123)));
1857+
18551858

18561859
// hmget/hmset with numeric fields
18571860
$this->redis->del('h');

0 commit comments

Comments
 (0)