title: FOR loop performance in PHP
body: <p>As my research leads me to believe that <code>for</code> loops are the fastest iteration construct in PHP... to make it clearer, which of the following do you think would be faster?</p>
  
  <h3>Example ONE</h3>
  
  <pre><code>for ($i = 0; $i &lt; count($myLargeArray); $i++ ) {
      echo myLargeArray[$i];
  }
  </code></pre>
  
  <h3>Example TWO</h3>
  
  <pre><code>$count = count($myLargeArray);
  for ($i = 0; $i &lt; $count; $i++ ) {
      echo myLargeArray[$i];
  }
  </code></pre>
  
  <p>My logic follows that on each iteration in example one accessing the length of myLargeArray on each iteration is more computationally expensive than accessing a simple integer value as in example two. Is that correct?</p>