{"action":"created","issue":{"url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/202","repository_url":"https://api.github.com/repos/php-memcached-dev/php-memcached","labels_url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/202/comments","events_url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/202/events","html_url":"https://github.com/php-memcached-dev/php-memcached/issues/202","id":118079755,"number":202,"title":"Possible Bug With Binary / Double Values","user":{"login":"ddrager","id":408520,"avatar_url":"https://avatars.githubusercontent.com/u/408520?v=3","gravatar_id":"","url":"https://api.github.com/users/ddrager","html_url":"https://github.com/ddrager","followers_url":"https://api.github.com/users/ddrager/followers","following_url":"https://api.github.com/users/ddrager/following{/other_user}","gists_url":"https://api.github.com/users/ddrager/gists{/gist_id}","starred_url":"https://api.github.com/users/ddrager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddrager/subscriptions","organizations_url":"https://api.github.com/users/ddrager/orgs","repos_url":"https://api.github.com/users/ddrager/repos","events_url":"https://api.github.com/users/ddrager/events{/privacy}","received_events_url":"https://api.github.com/users/ddrager/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-20T16:46:10Z","updated_at":"2016-03-09T15:00:09Z","closed_at":null,"body":"Having an occasional bug pop up, still trying to find the root cause but I believe it may be within php-memcached or even the Zend framework.\r\n\r\nI am using igbinary serializer to compress/serialize data, which is then stored in the external memcache server. I've verified the data is indeed stored in binary on the memcache server.\r\n\r\nOccasionally after a value is stored I begin to get the following error out of our memcached extension:\r\n\r\n```\r\nPHP Warning:  Memcached::get(): could not read double value, too big\r\n```\r\n\r\nThis is from [php_memcached.c#L3472](https://github.com/php-memcached-dev/php-memcached/blob/master/php_memcached.c#L3472)\r\n\r\nThe value is not stored in memcache as a double. I believe it is interpreting the binary value as a double, and since it is larger than a double it is triggering this error.\r\n\r\nI'm not very good at C but I think it ultimately comes from the Zend function for checking type [zend_operators.h](https://github.com/php/php-src/blob/PHP-5.6.16/Zend/zend_operators.h#L214).\r\n\r\nAs stated in the comment for that function, it will result in a double:\r\n\r\n```\r\n...\r\n// or IS_DOUBLE if the number was out of long range or contained a decimal point/exponent.\r\n...\r\n```\r\n\r\nMy best guess at this point is that sometimes the binary data matches:\r\n\r\n```\r\n(*ptr == '.' && ZEND_IS_DIGIT(ptr[1]))\r\n```\r\n\r\nSo assuming this is the issue, I'm not sure if the best way to handle this is within this repo or within PHP itself. I can't imagine that interpreting a binary value as a double would be good for anyone. \r\n\r\nDoes anyone have pointer towards how I can troubleshoot this? I have the variables stored in memcache (in binary), but I can't get them out since memcached->get fails out with the double value error.\r\n"},"comment":{"url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/comments/194334031","html_url":"https://github.com/php-memcached-dev/php-memcached/issues/202#issuecomment-194334031","issue_url":"https://api.github.com/repos/php-memcached-dev/php-memcached/issues/202","id":194334031,"user":{"login":"ddrager","id":408520,"avatar_url":"https://avatars.githubusercontent.com/u/408520?v=3","gravatar_id":"","url":"https://api.github.com/users/ddrager","html_url":"https://github.com/ddrager","followers_url":"https://api.github.com/users/ddrager/followers","following_url":"https://api.github.com/users/ddrager/following{/other_user}","gists_url":"https://api.github.com/users/ddrager/gists{/gist_id}","starred_url":"https://api.github.com/users/ddrager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddrager/subscriptions","organizations_url":"https://api.github.com/users/ddrager/orgs","repos_url":"https://api.github.com/users/ddrager/repos","events_url":"https://api.github.com/users/ddrager/events{/privacy}","received_events_url":"https://api.github.com/users/ddrager/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T15:00:09Z","updated_at":"2016-03-09T15:00:09Z","body":"We had a mixed server environment where some servers were still using the memcache extension to save, and then other servers would use memcached to read. This is definitely a non-issue and a configuration problem on my end. Thanks for the response!"}}