title: PHP Adding new key to the array used in foreach
body: <p>How can I add to the array that I'm using <code>foreach</code> on?</p>
  
  <p>for instance:</p>
  
  <pre><code>$t =array('item');
  $c = 1;
  foreach ($t as $item) {
      echo '--&gt; '.$item.$c;
      if ($c &lt; 10) {
          array_push($t,'anotheritem');
      }
  }
  </code></pre>
  
  <p>this seems to produce only one value ('item1'). It seems that <code>$t</code> is only being evaluated once (at first time of <code>foreach</code> use) but not after it enters the loop.</p>