title: Redis: How is the result of KEYS * sorted?
body: <p>I have a very simple php redis application which creates keys at certain events. All the keys are just counters and have an expire time of 24 hours. Basically a rolling window of 24 hours for every key to gather some statistics.</p>
  
  <pre><code>if ($redis-&gt;exists($key)) {
      $redis-&gt;incr($key); 
  }
  else {
      $redis-&gt;set($key, '1');
      $now = time(); // current timestamp
      $redis-&gt;expireAt($key, $now + 86400);
  }
  </code></pre>
  
  <p>When I extract an overview of all my keys with <code>$list = $redis-&gt;keys("*");</code> (or in a redis-cli console with <code>keys *</code>), I would suspect a chronological order by creation date. However this is not case. Neither are they ordered alphabetically, by value...</p>
  
  <p>So my question is, how is this list sorted? </p>