php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58341 3.0.x breaks BC with 2.2.x
Submitted: 2008-09-12 13:26 UTC Modified: 2009-01-16 10:38 UTC
From: ian at digg dot com Assigned:
Status: Closed Package: memcache (PECL)
PHP Version: 5.2.0 OS: Debian Etch
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ian at digg dot com
New email:
PHP Version: OS:

 

 [2008-09-12 13:26 UTC] ian at digg dot com
Description:
------------
On 2.2.x, if you passed an array to get() which contained only unset keys, you would get back an empty array. In 3.0.x, you get boolean FALSE.

The manual does not describe this behavior, though it strongly implies that when using multi-get you always get an array back:

?You can pass array of keys to Memcache::get() to get array of values. The _result array_ will contain only found key-value pairs.? (Emphasis mine)

This change in semantics isn't documented anywhere, and seems odd. It should either get reverted to the 2.2.x behavior or explicitly documented that multi-gets of unset keys return false. The former would be my preference.

Reproduce code:
---------------
var_dump($cache->get(array('foo', 'bar')));

Expected result:
----------------
array(0) {
}

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-16 10:38 UTC] mikael at synd dot info
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 10:01:30 2024 UTC