Edit report at https://bugs.php.net/bug.php?id=58084&edit=1
ID: 58084 Comment by: d dot h dot j dot takken at xs4all dot nl Reported by: sebastian at 7val dot com Summary: apc_store with ttl does not work anymore Status: Wont fix Type: Bug Package: APC Operating System: Linux 2.6.22 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I use Gearman to create workers running continuously on the server, processing jobs. So, one 'request' can last for weeks. The TTL problem really does hurt in this case, because the APC caches of the workers are never refreshed. Can this bug be reopened please? Thanks! Previous Comments: ------------------------------------------------------------------------ [2008-03-10 03:44:50] sebastian at 7val dot com You're right, with two separate requests it works as expected. The use case we have here is just a bad unit test, I suppose that doesn't count ;) Although this behavior should be documented somewhere... ------------------------------------------------------------------------ [2008-03-07 21:17:41] sh...@php.net This appears to be caused by the fact that the time comparison we use does not change within the same request (this is an optimization). If you repeat your test, but between two separate requests (one to set, another to fetch) it should work as expected. If you have a use case for such a short lived TTL within the same request then please re-open this bug and detail your use case. -Thanks ------------------------------------------------------------------------ [2008-03-07 08:06:20] sebastian at 7val dot com Description: ------------ I'm using PHP Version 5.2.5, and upgraded to APC 3.0.16 with 'pecl install apc'. The following code worked with APC 3.0.14, but with the new version, apc_store's $ttl-parameter seems to be ignored. Reproduce code: --------------- <?php apc_store('test', 'asdf', $ttl = 1); echo var_export(apc_fetch('test'), true) . "\n"; sleep(2); echo var_export(apc_fetch('test'), true) . "\n"; ?> Expected result: ---------------- 'asdf' false Actual result: -------------- 'asdf' 'asdf' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=58084&edit=1