{"action":"created","issue":{"url":"https://api.github.com/repos/colinmollenhour/credis/issues/84","repository_url":"https://api.github.com/repos/colinmollenhour/credis","labels_url":"https://api.github.com/repos/colinmollenhour/credis/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/colinmollenhour/credis/issues/84/comments","events_url":"https://api.github.com/repos/colinmollenhour/credis/issues/84/events","html_url":"https://github.com/colinmollenhour/credis/issues/84","id":258406482,"number":84,"title":"Pipeline returns different result format for HMGET in standalone/redis extension mode","user":{"login":"maff","id":27403,"avatar_url":"https://avatars2.githubusercontent.com/u/27403?v=4","gravatar_id":"","url":"https://api.github.com/users/maff","html_url":"https://github.com/maff","followers_url":"https://api.github.com/users/maff/followers","following_url":"https://api.github.com/users/maff/following{/other_user}","gists_url":"https://api.github.com/users/maff/gists{/gist_id}","starred_url":"https://api.github.com/users/maff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maff/subscriptions","organizations_url":"https://api.github.com/users/maff/orgs","repos_url":"https://api.github.com/users/maff/repos","events_url":"https://api.github.com/users/maff/events{/privacy}","received_events_url":"https://api.github.com/users/maff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-09-18T08:47:38Z","updated_at":"2017-09-21T09:52:09Z","closed_at":null,"author_association":"NONE","body":"When executing HMGET over a pipeline, the result is different in standalone and Redis extension mode. While a simple HMGET always returns an array with numeric indexes in both standalone and Redis extension mode, the HMGET over a pipeline with the Redis extension enabled returns an array indexed by field name instead. See the following test case (the `myhash` has is the one from https://redis.io/commands/hmset):\r\n\r\n```php\r\n<?php\r\n\r\nrequire_once __DIR__ . '/vendor/autoload.php';\r\n\r\n$id     = 'myhash';\r\n$fields = ['field1', 'field2'];\r\n\r\n$redis = new Credis_Client('127.0.0.1', 6379, null, '', 13);\r\n\r\nif (extension_loaded('redis')) {\r\n    echo \"The Redis extension is loaded\\n\\n\";\r\n} else {\r\n    echo \"The Redis extension is not loaded\\n\\n\";\r\n}\r\n\r\n// simple hMGet\r\necho \"Simple HMGET\\n\";\r\nvar_dump($redis->hMGet($id, $fields));\r\necho \"\\n\";\r\n\r\n// pipeline HMGET\r\necho \"Pipeline HMGET\\n\";\r\n\r\n$pipeline = $redis->pipeline()->multi();\r\n$pipeline->hMGet($id, $fields);\r\nvar_dump($pipeline->exec()[0]);\r\n```\r\n\r\nWithout Redis extension:\r\n\r\n```shell\r\nThe Redis extension is not loaded\r\n\r\nSimple HMGET\r\n/home/vagrant/credis-index/credis-test.php:18:\r\narray(2) {\r\n  [0] =>\r\n  string(5) \"Hello\"\r\n  [1] =>\r\n  string(5) \"World\"\r\n}\r\n\r\nPipeline HMGET\r\n/home/vagrant/credis-index/credis-test.php:26:\r\narray(2) {\r\n  [0] =>\r\n  string(5) \"Hello\"\r\n  [1] =>\r\n  string(5) \"World\"\r\n}\r\n```\r\n\r\nWith Redis extension (see Pipeline HMGET):\r\n\r\n```shell\r\nThe Redis extension is loaded\r\n\r\nSimple HMGET\r\n/home/vagrant/credis-index/credis-test.php:18:\r\narray(2) {\r\n  [0] =>\r\n  string(5) \"Hello\"\r\n  [1] =>\r\n  string(5) \"World\"\r\n}\r\n\r\nPipeline HMGET\r\n/home/vagrant/credis-index/credis-test.php:26:\r\narray(2) {\r\n  'field1' =>\r\n  string(5) \"Hello\"\r\n  'field2' =>\r\n  string(5) \"World\"\r\n}\r\n```\r\n\r\nPHP version: PHP 7.1.6\r\nRedis extension version: 3.1.2\r\nRedis version: 3.2.8\r\ncolinmollenhour/credis: 1.8.2"},"comment":{"url":"https://api.github.com/repos/colinmollenhour/credis/issues/comments/331109156","html_url":"https://github.com/colinmollenhour/credis/issues/84#issuecomment-331109156","issue_url":"https://api.github.com/repos/colinmollenhour/credis/issues/84","id":331109156,"user":{"login":"Xon","id":635541,"avatar_url":"https://avatars0.githubusercontent.com/u/635541?v=4","gravatar_id":"","url":"https://api.github.com/users/Xon","html_url":"https://github.com/Xon","followers_url":"https://api.github.com/users/Xon/followers","following_url":"https://api.github.com/users/Xon/following{/other_user}","gists_url":"https://api.github.com/users/Xon/gists{/gist_id}","starred_url":"https://api.github.com/users/Xon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xon/subscriptions","organizations_url":"https://api.github.com/users/Xon/orgs","repos_url":"https://api.github.com/users/Xon/repos","events_url":"https://api.github.com/users/Xon/events{/privacy}","received_events_url":"https://api.github.com/users/Xon/received_events","type":"User","site_admin":false},"created_at":"2017-09-21T09:52:09Z","updated_at":"2017-09-21T09:52:09Z","author_association":"NONE","body":"@maff I've had some time today and I believe I've fixed the bugs."}}
{"actor":{"display_login":"Xon"}}