title: Eloquent collections: each vs foreach
body: <p>Might not be a question specific to Eloquent collections, but it just hit me while working with them. Let's just assume we have a <code>$collection</code> object which is an instance of <code>Illuminate\Support\Collection</code>.</p>
  <p>Now if we want to iterate over it, what are the pros and cons of using <code>each()</code> with a closure versus a regular <code>foreach</code>. Are there any?</p>
  <pre><code>foreach ($collection as $item) {
      // Some code
  }
  </code></pre>
  <p>versus</p>
  <pre><code>$collection-&gt;each(function ($item) {
      // Some code
  });
  </code></pre>