php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59490 memcache::get() has problem with ints?
Submitted: 2010-11-03 02:54 UTC Modified: 2010-11-26 01:03 UTC
From: errietta at hotmail dot com Assigned: hradtke (profile)
Status: Closed Package: memcache (PECL)
PHP Version: 5.3.2 OS: ubuntu 10.04
Private report: No CVE-ID: None
 [2010-11-03 02:54 UTC] errietta at hotmail dot com
Description:
------------
In PHP Version 5.3.2-1ubuntu4.5, php-memcache version 3.0.4-
2build1
When setting an integer value using memcache::set I can 
retrieve it without a problem by connecting to 
localhost:11211 and issuing a GET command. However, 
memcache::get will always return false when outputting the 
value of that variable.
The same also happens with floats (such as 0.5)

Reproduce code:
---------------
Example PHP code
<?php
	$memcache_obj = new Memcache();
	$memcache_obj -> connect ('localhost',11211);
	$memcache_obj -> set ("my_var", 5, MEMCACHE_COMPRESSED, 0);
	var_dump ($memcache_obj -> get ("my_var")); //will always output bool(false)
?>
However, using netcat:
errietta@Mewtwo:~$ nc localhost 11211
get my_var
VALUE my_var 770 1
5
END



Expected result:
----------------
I was expecting my_var to be an int(5)

Actual result:
--------------
bool (false) was outputted.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-03 02:58 UTC] errietta at hotmail dot com
Note: The function works fine if MEMCACHE_COMPRESSED is not 
used
 [2010-11-26 01:03 UTC] hradtke@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/memcache

Fixed in 3.0.5
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 04:01:33 2024 UTC