php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #45660 Memcache documentation / behavior mismatch on get()
Submitted: 2008-07-30 15:36 UTC Modified: 2008-08-03 21:02 UTC
From: joe at econversions dot co dot uk Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Ubuntu / Debian / Redhat
Private report: No CVE-ID: None
 [2008-07-30 15:36 UTC] joe at econversions dot co dot uk
Description:
------------
There is a discrepancy in the documentation and actual behaviour of the Memcache module regarding Memcache::get().

The documentation states that the get() method supports two parameters, the second being a flag (of which only the compression flag seems listed).

It is apparent that the get() method only supports one parameter exactly, raising an e_warning.

This is a documentation update request.

Reproduce code:
---------------
php > $m = new Memcache();
php > $m->addServer('localhost', 11211);
php > echo $m->get('test', MEMCACHE_COMPRESSED);
Warning: Memcache::get() expects exactly 1 parameter, 2 given in php shell code on line 1

Expected result:
----------------
No error/warning, supplied flags passed through.

Actual result:
--------------
e_warning.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-03 21:02 UTC] dmytton@php.net
Documentation is correct. In revision 1.83.2.14 the flags parameter was added by mikl. See http://cvs.php.net/viewvc.cgi/pecl/memcache/memcache.c?annotate=1.83.2.14 line 1392 and compare to 1.83.2.13 where it is not present.

Make sure you're running the latest PECL from http://pecl.php.net/package/memcache
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jun 18 01:00:02 2026 UTC