php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77809 getStats() may return false
Submitted: 2019-03-27 15:00 UTC Modified: 2020-10-21 16:35 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: fgm at osinet dot fr Assigned:
Status: Closed Package: memcached (PECL)
PHP Version: 7.2.16 OS: macOS Mojave
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
34 + 32 = ?
Subscribe to this entry?

 
 [2019-03-27 15:00 UTC] 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

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-21 16:09 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-10-21 16:35 UTC] 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
 [2020-10-21 16:35 UTC] cmb@php.net
-Assigned To: cmb +Assigned To:
 [2020-10-29 16:24 UTC] phpdocbot@php.net
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
 [2020-10-29 16:24 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 29 18:01:24 2020 UTC