A simple memcache-backed implimentation that cycles through a set of values
define('MEMCYCLE_SERVERS', '10.0.0.1:11211,10.0.0.2:11211');
define('MEMCYCLE_TTL', 0);
$options = array('a', 'b', 'c');
memq::create('letters', $options);
$next = memq::next('letters');
// $next is 'a'
$next = memq::next('letters');
// $next is 'b'
$next = memq::next('letters');
// $next is 'c'
$next = memq::next('letters');
// $next is 'a'
$next = memq::random('letters');
// next is a random item from $options