The Note You're Voting On
nate ¶ 17 years ago
Be aware that when using the multi-key version, Memcache::get returns bool false if no servers are configured for the pool (and possibly if other errors occur as well while attempting to fetch). Also, Memcache class throws annoying warnings on every get/set/delete-type calls if you have no servers added to the pool.
The following snippet var_dump's bool false, not an empty array like you might expect.
<?php
$cache = new Memcache;
// no $cache->addServer calls (for example,
due to temporarily disabling use of cache)
// use @ symbol to ignore warning
var_dump(
@$cache->get(array('one', 'two'))
);
?>