|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-02-23 18:09 UTC] marc-bennewitz at arcor dot de
Description:
------------
APCIterator returns expired items with APC_LIST_ACTIVE and apc.use_request_time disabled
Reproduce code:
---------------
ini_set('apc.use_request_time', 0);
apc_store('key0', 'value0', 100);
apc_store('key1', 'value1', 1);
apc_store('key2', 'value2', 2);
sleep(2);
$it = new APCIterator('user', '/key./', APC_ITER_DTIME, 1, APC_LIST_ACTIVE);
var_dump( iterator_to_array($it) );
Expected result:
----------------
array(1) {
["key0"]=>
array(1) {
["deletion_time"]=>
int(0)
}
}
Actual result:
--------------
array(3) {
["key0"]=>
array(1) {
["deletion_time"]=>
int(0)
}
["key1"]=>
array(1) {
["deletion_time"]=>
int(0)
}
["key2"]=>
array(1) {
["deletion_time"]=>
int(0)
}
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 23:00:01 2025 UTC |
Interesting, apc only moves stuff off the ACTIVE list when a fetch() happens. So changing the code to do - sleep(2) + sleep(3); + apc_fetch('key1'); + apc_fetch('key2'); Would work just fine. But I'll have to fix it to skip expired entries in fetch_active()