title: Nested foreach in PHP produces different results than I expect
body: <p>I'm having problems to iterate twice on the same array:  </p>
  
  <pre><code>&lt;? $indice=0 ?&gt;
  &lt;?php foreach ($comisiones as $comision1):?&gt;  
    &lt;tr&gt;  
      &lt;td&gt;&lt;?php echo ++$indice ?&gt;&lt;/td&gt;  
      &lt;td&gt;&lt;?php echo tag('select',array('name'=&gt;'comision_'.$indice),true)?&gt;  
            &lt;?php foreach ($comisiones as $comision2):?&gt;  
              &lt;option value="&lt;?php echo $comision2-&gt;getId()?&gt;"&gt;
                 &lt;?php echo $comision2-&gt;getNombre()." - ".$comision2-&gt;getDescripcion()?&gt; 
              &lt;/option&gt;
            &lt;?php endforeach?&gt; 
          &lt;/select&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;?php endforeach?&gt;  
  </code></pre>
  
  <p>The above code prints:</p>
  
  <p><a href="https://i.stack.imgur.com/g3txF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g3txF.png" alt="code result"></a>
  </p>
  
  <p>And I'm expecting to see something like this (labels of the combos in the images are not the same, but I think the idea is clear):  </p>
  
  <p><a href="https://i.stack.imgur.com/eg9dj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eg9dj.png" alt="expected results"></a>
  </p>
  
  <p>Thanks in advance</p>