Doc #77809 [Ver->Csd]: getStats() may return false

From: Date: Thu, 29 Oct 2020 16:24:10 +0000
Subject: Doc #77809 [Ver->Csd]: getStats() may return false
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18049@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77809&edit=1 ID: 77809 Updated by: phpdocbot@php.net Reported by: fgm at osinet dot fr Summary: getStats() may return false -Status: Verified +Status: Closed Type: Documentation Problem Package: memcached Operating System: macOS Mojave PHP Version: 7.2.16 Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmb Revision: http://git.php.net/?p=doc/en.git;a=commit;h=a05eccd80a09d8891b3f08e9277ee6625982d944 Log: Fix #77809: getStats() may return false Previous Comments: ------------------------------------------------------------------------ [2020-10-21 16:35:36] cmb@php.net The following pull request has been associated: Patch Name: Fix #77809: getStats() may return false On GitHub: https://github.com/php/doc-en/pull/160 Patch: https://github.com/php/doc-en/pull/160.patch ------------------------------------------------------------------------ [2019-03-27 15:00:30] fgm at osinet dot fr Description: ------------ --- From manual page: https://php.net/memcached.getstats always returns an array --- If no server is available, Memcached::getStats() will return false instead of returning an array as documented. The code behavior is actually more logical, and consistent with the behavior of the Memcache extension in that case, so it really is a documentation issue, not a code issue. Test script: --------------- $mc = new \Memcached('bin'); $mc->addServer('127.0.0.1', '11239'); // Assuming an unavailable instance. $stats = $mc->getStats(); echo ($stats === false) ? "KO" : "OK"; Expected result: ---------------- OK Actual result: -------------- KO ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77809&edit=1

« previous php.doc.bugs (#18049) next »