pecl-memcache
pecl-memcache copied to clipboard
Provide a getResultCode() to check if the most recent memcache operation had an error?
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
- The value false, from unserialize() (if applications used them)
- A cache miss (absence can be detected with $flags)
- 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