php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59344 sleep() does not affect on "creation_time"
Submitted: 2010-08-07 17:53 UTC Modified: 2010-08-07 17:58 UTC
From: fruit dot dev at gmail dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.2.13 OS: Fedora 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
36 + 46 = ?
Subscribe to this entry?

 
 [2010-08-07 17:53 UTC] fruit dot dev at gmail dot com
Description:
------------
If some cache are stored after calling sleep(), its creation_time is time, when php script was executed without adding slept time.

Reproduce code:
---------------
<?php

  print time() . "\n";
  apc_clear_cache('user');

  apc_store('CompanyName_31', 'Google Inc.', 86400);

  sleep(5);

  apc_store('Location_27', '1600 Amphitheatre Parkway', 84600);

  print time() . "\n";
  
  var_dump(apc_cache_info('user'));

Expected result:
----------------
// imagine, time() returns value: 1281216994


1281216994

// var_dump shows, that "CompanyName_31" creation_time is: 1281216994
// var_dump shows, that "Location_27" creation_time is: 1281216999

1281216999

Actual result:
--------------
// imagine, time() returns value: 1281216994


1281216994
// var_dump shows, that "CompanyName_31" creation_time is: 1281216994
// var_dump shows, that "Location_27" creation_time is: 1281216994

1281216999

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-07 17:58 UTC] rasmus@php.net
Once again, we assume short web requests and optimize our 
system calls and use the request time for the cache 
timestamps.  If you have long-running scripts where you don't 
want to use the request time, set:

apc.use_request_time = 0

in your php.ini file.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 02:01:29 2024 UTC