title: PHP execution times on second run of the same code
body: <p>I have a curiosity. I created a simple php script that creates an array of 1 mil simple array elements and then loops through them.</p>
  
  <p>On the first execution, it seems to take about ~1,4 seconds. 
  But on the second execution of the same code, it always takes about ~2,1 seconds. I've repeated this several times with the same results.</p>
  
  <p>Why is this?</p>
  
  <p>Code sample here:</p>
  
  <pre><code>    $timeStart = microtime(true);
  
      $invoices = array();
      for ($i = 1; $i &lt;= 1000000; $i++) {
          $invoices[] = array(
              'issuedValue' =&gt; $i,
              'fiscalNumber' =&gt; $i,
              'random1' =&gt; $i,
              'random2' =&gt; $i,
              'random3' =&gt; $i,
          );
      }
      foreach ($invoices as $invoice) {
          // nothing here
      }
  
      var_dump(microtime(true) - $timeStart);
  
      // second iteration here
  
      $timeStart = microtime(true);
  
      $invoices = array();
      for ($i = 1; $i &lt;= 1000000; $i++) {
          $invoices[] = array(
              'issuedValue' =&gt; $i,
              'fiscalNumber' =&gt; $i,
              'random1' =&gt; $i,
              'random2' =&gt; $i,
              'random3' =&gt; $i,
          );
      }
      foreach ($invoices as $invoice) {
          // nothing here
      }
  
      var_dump(microtime(true) - $timeStart);
  </code></pre>