php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70992 Wrong documentation
Submitted: 2015-11-28 22:49 UTC Modified: 2015-11-29 16:00 UTC
From: fekzol dot 13ker at gmail dot com Assigned:
Status: Not a bug Package: memcache (PECL)
PHP Version: 5.6Git-2015-11-28 (snap) OS: Ubuntu 14.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fekzol dot 13ker at gmail dot com
New email:
PHP Version: OS:

 

 [2015-11-28 22:49 UTC] fekzol dot 13ker at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/memcached.set
---

The exmaple code is wrong:
/* expire 'object' key in 5 minutes */
$m->set('object', new stdclass, time() + 300);



Test script:
---------------
The example is wrong.
$m->set('object', new stdclass, time() + 300);

If you want to store the data for 5 minute, you have to do this:

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

Not: time() + 300;


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-29 02:32 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2015-11-29 02:32 UTC] requinix@php.net
Both are acceptable to memcache: 300 is like a TTL while time()+300 is like an expiration.
 [2015-11-29 12:16 UTC] salathe@php.net
Also, we have a page dedicated to Memcached expiration times: php.net/manual/en/memcached.expiration.php
 [2015-11-29 16:00 UTC] fekzol dot 13ker at gmail dot com
alright, got it. I bit missleading but ok.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC