title: PHP Memcached string size exceeds
body: <p>The following code</p>
  
  <pre><code>$memcached = new Memcached();
  
  $memcached-&gt;addServer('127.0.0.1', 11211);
  
  $data = json_encode(array(
          'string1' =&gt; md5(time()),
          'string2' =&gt; md5(time())
  ));
  
  var_dump($memcached-&gt;set('foo', $data, 300));
  </code></pre>
  
  <p>is working just fine</p>
  
  <pre><code># telnet 127.0.0.1 11211
  # get foo
  VALUE foo 0 91
  {"string1":"884e036fd865cac1ef26b5f7a920c2c2","string2":"884e036fd865cac1ef26b5f7a920c2c2"}
  </code></pre>
  
  <p>but when I add a third line</p>
  
  <pre><code>$data = json_encode(array(
          'string1' =&gt; md5(time()),
          'string2' =&gt; md5(time()),
          'string3' =&gt; md5(time())
  ));
  
  var_dump($memcached-&gt;set('foo', $data, 300));
  </code></pre>
  
  <p>it produces the following</p>
  
  <pre><code># get foo
  VALUE foo 16 63
  x«V*.)ÊÌK7T²RJ322J11KL6M4I4OM¶°H57·4716I5Oµ0NSÒ*6"E±11krW&amp;z
  </code></pre>
  
  <p>I guess memcached is compressing the value somehow, but why isn't it reverting it on get?</p>
  
  <p>Any idea how to solve it?</p>