Doc #77809 [NEW]: getStats() may return false

From: Date: Wed, 27 Mar 2019 15:00:30 +0000
Subject: Doc #77809 [NEW]: getStats() may return false
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16526@lists.php.net to get a copy of this message
From:             fgm at osinet dot fr
Operating system: macOS Mojave
PHP version:      7.2.16
Package:          memcached
Bug Type:         Documentation Problem
Bug description:getStats() may return false

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 bug report at https://bugs.php.net/bug.php?id=77809&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77809&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77809&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77809&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77809&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77809&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77809&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77809&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77809&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77809&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77809&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77809&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77809&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77809&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77809&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77809&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77809&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77809&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77809&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77809&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77809&r=mysqlcfg



Thread (4 messages)

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