protected function doContains($id) { $flags = null; $this->memcache->get($id, $flags); //if memcache has changed the value of "flags", it means the value exists return $flags !== null; }