note 94724 rejected from function.memcache-get by danbrown

From: Date: Thu, 03 Dec 2009 14:09:21 +0000
Subject: note 94724 rejected from function.memcache-get by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163535@lists.php.net to get a copy of this message
Note Submitter: ibekowies at mindworks dot de ---- There seems to be a bug at least in some versions concerning memcache multi gets. When i add objects or arrays to the memcache and retrieve them with a multi get, the keys in the resulting array are really strange. I cannot access the objects in the array - even if they appear in a var_dump(). Other types are working properly. testscript: <?php print '<pre>'; $memcache = new Memcache(); $memcache->addServer('localhost', '11211'); $key = 'memcacheBug123'; $var = array('testValue'); $memcache->set($key, $var); $keys = array($key); $data = $memcache->get($keys); print 'key ('.$key.') exists? '.(array_key_exists($key, $data) ? 'yes' : 'no (but it should!)')."\n\n"; print '<hr />'."\n\n"; print print_r($data, 1)."\n\n"; $data[$key] = 'strange...'; print '<hr />'."\n\n"; print print_r($data, 1)."\n\n"; php version: 5.2.6-2ubuntu4.3 memcache extension: 3.0.1-1 $Revision: 1.83.2.24 $ memcached: 1.2.2-1+lenny1build0.8.10.1

« previous php.notes (#163535) next »