|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70062 setMulti list of expirations
Submitted: 2015-07-13 11:36 UTC Modified: 2021-06-09 11:54 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: guadenine at gmail dot com Assigned: cmb (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 5.6.11 OS: CentOS 6.5
Private report: No CVE-ID: None
 [2015-07-13 11:36 UTC] guadenine at gmail dot com
From manual page:

Looking for the ability to set custom expiration for every item in $items.

At the moment, you can pass multiple items but only a single expiration for all of them.

Here is how it currently works:

$items = array(
    'key1' => 'value1',
    'key2' => 'value2'

Memcached::setMulti($items, 3600); // Sets 1 hour for all items, no customization

I want to be able to provide an array of expiration times that each map to the expiration of the item's position.

Here is how it would work:

$items = array(
    'key1' => 'value1 long expiration',
    'key2' => 'value2 short expiration'

$expirations = array(

Memcached::setMulti($items, $expirations);

This way, you can map expiration to every item in $items, offering much more flexibility.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-09 11:54 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-09 11:54 UTC]
The memcached bug tracker is now on Github[1].  If this is still
an issue with the current memcached version, please report there.

[1] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 18:01:36 2024 UTC