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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fgm at osinet dot fr
New email:
PHP Version: OS:

 

 [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

Pull Requests

Pull requests:

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
 [2020-10-30 09:45 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=829af1e9e1e3853ad891185ea54335cdd5d5aa30
Log: Fix #77809: getStats() may return false
 [2020-12-30 11:58 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=5c46ec3dce1dcb8101c6c9b33a4ab4be6c339c08
Log: Fix #77809: getStats() may return false
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 00:01:30 2024 UTC