note 94724 added to function.memcache-get

From: Date: Fri, 20 Nov 2009 14:43:36 +0000
Subject: note 94724 added to function.memcache-get
Groups: php.notes 
Request: Send a blank email to php-notes+get-163125@lists.php.net to get a copy of this message
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 ---- Server IP: 212.124.37.9 Probable Submitter: 193.7.250.35 ---- Manual Page -- http://www.php.net/manual/en/function.memcache-get.php Edit -- https://master.php.net/note/edit/94724 Del: integrated -- https://master.php.net/note/delete/94724/integrated Del: useless -- https://master.php.net/note/delete/94724/useless Del: bad code -- https://master.php.net/note/delete/94724/bad+code Del: spam -- https://master.php.net/note/delete/94724/spam Del: non-english -- https://master.php.net/note/delete/94724/non-english Del: in docs -- https://master.php.net/note/delete/94724/in+docs Del: other reasons-- https://master.php.net/note/delete/94724 Reject -- https://master.php.net/note/reject/94724 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#163125) next »