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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fruit dot dev at gmail dot com
New email:
PHP Version: OS:

 

 [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-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 30 08:01:24 2021 UTC