note 84032 added to function.memcache-set

From: Date: Wed, 25 Jun 2008 00:12:20 +0000
Subject: note 84032 added to function.memcache-set
Groups: php.notes 
Request: Send a blank email to php-notes+get-140782@lists.php.net to get a copy of this message
Using set more than once for the same key seems to have unexpected results - it does not behave as a "replace," but instead seems to "set" more than one value for the same key. "get" may return any of the values. This was tested on a multiple-server setup - behaviour may be different if you only have one server. Remedy is to use a combination of replace and set: $result = $memcache->replace( $key, $var ); if( $result == false ) { $result = $memcache->set( $key, $var ); } ---- Server IP: 92.48.74.199 Probable Submitter: 87.194.131.1 ---- Manual Page -- http://www.php.net/manual/en/function.memcache-set.php Edit -- https://master.php.net/note/edit/84032 Del: integrated -- https://master.php.net/note/delete/84032/integrated Del: useless -- https://master.php.net/note/delete/84032/useless Del: bad code -- https://master.php.net/note/delete/84032/bad+code Del: spam -- https://master.php.net/note/delete/84032/spam Del: non-english -- https://master.php.net/note/delete/84032/non-english Del: in docs -- https://master.php.net/note/delete/84032/in+docs Del: other reasons-- https://master.php.net/note/delete/84032 Reject -- https://master.php.net/note/reject/84032 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140782) next »