Hi everyone,
I have started to try APC to store some specific data on each webserver as an complement to memcached.
However, the following code piece is giving me headaches:
echo apc_store('key', 'value');
echo apc_store('key', 'newvalue');
echo apc_fetch('key');
// Echoes: value
Memcached example:
$memcached = new Memcached;
$memcached->addServer('localhost', '11211');
$memcached->set('key', 'value1');
echo $memcached->get('key') . '<br />'; // Echoes value1
$memcached->set('key', 'value2');
echo $memcached->get('key'). '<br />'; // Echoes value2
$memcached->set('key', 'value3');
echo $memcached->get('key'). '<br />'; // Echoes value3
Why is apc_store not working as properly?
EDIT: To make sure that no one else is spending two hours on looking for a solution, when this is caused by a bug, here's one: http://pecl.php.net/bugs/bug.php?id=16894&edit=1 (not the most effective, though)