|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-09-05 12:39 UTC] stanislav dot khromov at gmail dot com
Description:
------------
APC 3.1.13, Apache
Cache TTL does not expire during a request.
Check script. It stores a variable for 5 seconds and then sleeps. But even after 5 seconds has gone and the TTL has expired the variable is still returned.
Test script:
---------------
<?php
apc_store('foo', 'bar', 5);
var_dump(apc_fetch('foo'));
sleep(2);
echo '<br/>';
var_dump(apc_fetch('foo')) . '<br/>';
sleep(2);
echo '<br/>';
var_dump(apc_fetch('foo')) . '<br/>';
sleep(2);
echo '<br/>';
var_dump(apc_fetch('foo')) . '<br/>';
sleep(2);
echo '<br/>';
Expected result:
----------------
string(3) "bar"
string(3) "bar"
bool(false)
bool(false)
Actual result:
--------------
string(3) "bar"
string(3) "bar"
string(3) "bar"
string(3) "bar"
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
apc.php <?php error_reporting(-1); ini_set('display_errors', '1'); $bar = "EEE"; apc_store ('foo', $bar, 40); var_dump(apc_fetch('foo')); sleep(20); var_dump(apc_fetch('foo')); sleep(20); $gg = shell_exec("php apc2.php"); echo $gg; apc.php <?php var_dump(apc_fetch('foo')); php apc.php string(3) "EEE" string(3) "EEE" bool(false) result is good var are loaded at start or after declaration of apc_store. to see cash down you to exec an other script, else it will not disappear.