php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57384 False as Return Value breaks storing vars with value "false"
Submitted: 2006-11-20 08:42 UTC Modified: 2006-11-20 08:57 UTC
From: php at xaospage dot de Assigned:
Status: Not a bug Package: memcache (PECL)
PHP Version: 5.2.0 OS: Debian Linux
Private report: No CVE-ID: None
 [2006-11-20 08:42 UTC] php at xaospage dot de
Description:
------------
False as Return Value breaks storing vars with value "false"

If i want to save an value "false" into memcache, everything is fine.
If i want this value back(specified by id), an problem occurs:

false is also the returnvalue for Memcache::get, so i can't get the value because if I check for an false value, i can't differ if it is the value of my memcache id or a failure within memcache(FALSE on failure or if such key was not found.)
I would suggest to use failure codes for not in cache and for failure (eg -1 or -2 ).
But this will break BC..

http://de.php.net/manual/en/function.memcache-get.php




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-20 08:45 UTC] php at xaospage dot de
changed Version from 5.20 RC4 (latest version beside CVS head in dropdownbox ) to 5.20
 [2006-11-20 08:57 UTC] tony2001 at phpclub dot net
Duplicate of FR #6367: http://pecl.php.net/bugs/bug.php?id=6367
The reasons why it won't be changed are explained there.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 04:01:27 2024 UTC