note 92259 added to memcached.set
| From: | miha at hribar dot info | Date: | Thu, 16 Jul 2009 15:26:33 +0000 |
| Subject: | note 92259 added to memcached.set | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158371@lists.php.net to get a copy of this message | ||
The method correctly returns false if you set the value to false. This means that in order to have
proper fault checking mechanism in place you need to check the result code.
<?php
$Memcached = new Memcached();
$Memcached->addServer('localhost', 11211);
$Memcached->set('key', false);
var_dump($Memcached->get('key')); // boolean false
var_dump($Memcached->getResultCode()); // int 0 which is Memcached::RES_SUCCESS
?>
----
Server IP: 91.185.195.14
Probable Submitter: 84.255.245.231
----
Manual Page -- http://www.php.net/manual/en/memcached.set.php
Edit -- https://master.php.net/note/edit/92259
Del: integrated -- https://master.php.net/note/delete/92259/integrated
Del: useless -- https://master.php.net/note/delete/92259/useless
Del: bad code -- https://master.php.net/note/delete/92259/bad+code
Del: spam -- https://master.php.net/note/delete/92259/spam
Del: non-english -- https://master.php.net/note/delete/92259/non-english
Del: in docs -- https://master.php.net/note/delete/92259/in+docs
Del: other reasons-- https://master.php.net/note/delete/92259
Reject -- https://master.php.net/note/reject/92259
Search -- https://master.php.net/manage/user-notes.php