php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55818 Memcached::getByKey returns false when cas requested
Submitted: 2011-09-30 07:45 UTC Modified: 2011-09-30 07:54 UTC
From: nikrush at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.8 OS: Debian 6
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: nikrush at gmail dot com
New email:
PHP Version: OS:

 

 [2011-09-30 07:45 UTC] nikrush at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/memcached.getbykey#refsect1-
memcached.getbykey-returnvalues
---

Memcached::getByKey returns false when cas requested.

Test script:
---------------
$mc = new Memcached('MEMCACHED_SERVER_ID');
$mc->addServer('localhost', 11211);

var_dump(
    $mc->setByKey('server', 'key', 'set_value'),
    $mc->getResultMessage(),
    $mc->getResultCode(),
    '-----------------------------------',
    $mc->getByKey('server', 'key', null, $cas),
    $mc->getResultMessage(),
    $mc->getResultCode(),
    $cas,
    '-----------------------------------',
    $mc->getByKey('server', 'key'),
    $mc->getResultMessage(),
    $mc->getResultCode()
);

Expected result:
----------------
bool(true)
string(7) "SUCCESS"
int(0)
string(35) "-----------------------------------"
string(9) "set_value"
string(7) "SUCCESS"
int(0)
float(17086)
string(35) "-----------------------------------"
string(9) "set_value"
string(7) "SUCCESS"
int(0)

Actual result:
--------------
bool(true)
string(7) "SUCCESS"
int(0)
string(35) "-----------------------------------"
bool(false)
string(7) "SUCCESS"
int(0)
float(17086)
string(35) "-----------------------------------"
string(9) "set_value"
string(7) "SUCCESS"
int(0)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-30 07:54 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-09-30 07:54 UTC] pajoye@php.net
Please report it at http://pecl.php.net/memcached
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 04:01:34 2025 UTC