pecl-memcache icon indicating copy to clipboard operation
pecl-memcache copied to clipboard

Provide a getResultCode() to check if the most recent memcache operation had an error?

Open TysonAndre opened this issue 4 years ago • 0 comments

The related Memcached pecl provides https://www.php.net/manual/en/memcached.getresultcode.php https://www.php.net/manual/en/memcached.getresultmessage.php

Otherwise, workarounds have to be used to distinguish between

  1. The value false, from unserialize() (if applications used them)
  2. A cache miss (absence can be detected with $flags)
  3. An memcache protocol error/timeout that caused Memcache to return false (error_clear_last()/error_get_last() can be used as a workaround, unless set_error_handler's callback has the possibility of clearing the last error or triggering other notices)

https://bugs.php.net/bug.php?id=69809 is vaguely related but I'm guessing behavior changed in php7

TysonAndre avatar Aug 12 '20 21:08 TysonAndre