title: What is the performace of PHPs strtotime()?
body: <p>I am doing some large timestamp-list iterations: Putting them in <a href="https://stackoverflow.com/questions/3888595/list-of-events-with-a-list-of-timestamps-grouped-by-hour-in-a-tabular-display-i">tables with date-ranges</a>, and grouping them by ranges. 
  In order to do that, I found <code>strtotime()</code> a very helpfull function, but I am worried about its <strong>performance</strong>.</p>
  
  <p>For example, a function that loops over a list of weeks (say, week 49 to 05) and has to decide the beginning of the week and the timestamp at the end of that week. A usefull way to do that, would be:</p>
  
  <pre><code>foreach ($this-&gt;weeks($first, $amount) as $starts_at) {
    $ends_at = strtotime('+1 week', $starts_at);
    $groups[$week_key] = $this-&gt;slice($timestamps, $starts_at, $ends_at);
  }
  
  //$this-&gt;weeks returns a list of timestamps at which each week starts.
  //$this-&gt;slice is a simple helper that returns only the timestamps within a range, from a list of timestamps. 
  </code></pre>
  
  <p>Instead of <code>strtotime()</code>, I could, potentially, find out the amount of seconds between begin and end of the week, 99% of the times that would be <code>24 * 60 * 60 * 7</code>. But in these rare cases where there is a DST-switch, that 24 should either be 23 or 25. Code to sort that out, will probably be a lot slower then <code>strtotime()</code>, not?</p>
  
  <p>I use the same patterns for ranges of years, months (months, being very inconsistent!), days and hours. Only with hours would I suspect simply adding <code>3600</code> to the timestamp is faster. </p>
  
  <p>Any other gotcha's? Are there ways (that do not depend on PHP5.3!) that offer better routes for consistent, DST and leap-year safe dateranges?</p>