Doc #77809 [PATCH]: getStats() may return false
Edit report at https://bugs.php.net/bug.php?id=77809&edit=1
ID: 77809
Patch added by: cmb@php.net
Reported by: fgm at osinet dot fr
Summary: getStats() may return false
Status: Verified
Type: Documentation Problem
Package: memcached
Operating System: macOS Mojave
PHP Version: 7.2.16
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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
Thread (4 messages)