ConFoo Montreal 2026: Call for Papers

Voting

: two plus two?
(Example: nine)

The Note You're Voting On

PeterN
9 years ago
In the example it shows:

/* expire 'object' key in 5 minutes */
$m->set('object', new stdclass, time() + 300);

But this is wrong.
It will not expire, at least, not for a long long time.
So instead of time() + seconds, you use:
$m->set('object', new stdclass, 300);
And it will correctly expire after 5 minutes.

Note: Using memcached 2.1.0 stable through PECL.

<< Back to user notes page

To Top