note 92275 added to memcached.get

From: Date: Fri, 17 Jul 2009 08:31:34 +0000
Subject: note 92275 added to memcached.get
Groups: php.notes 
Request: Send a blank email to php-notes+get-158397@lists.php.net to get a copy of this message
This method also returns false in case you set the value to false, so in order to have a proper fault mechanism in place you need to check the result code to be certain that a key really does not exist in memcached. <?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 ?> Or just make sure the values are not false :) ---- Server IP: 213.250.2.28 Probable Submitter: 84.255.245.231 ---- Manual Page -- http://www.php.net/manual/en/memcached.get.php Edit -- https://master.php.net/note/edit/92275 Del: integrated -- https://master.php.net/note/delete/92275/integrated Del: useless -- https://master.php.net/note/delete/92275/useless Del: bad code -- https://master.php.net/note/delete/92275/bad+code Del: spam -- https://master.php.net/note/delete/92275/spam Del: non-english -- https://master.php.net/note/delete/92275/non-english Del: in docs -- https://master.php.net/note/delete/92275/in+docs Del: other reasons-- https://master.php.net/note/delete/92275 Reject -- https://master.php.net/note/reject/92275 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#158397) next »