title: PHP - foreach loops - $arr and &$value as same variable
body: <pre><code>foreach($foo as &amp;$bar) {
    //do something
  }
  </code></pre>
  
  <p>This is the syntax for a foreach loop in PHP. Usually, <code>$foo</code> &amp; <code>$bar</code> are different variables, but my question is can they be the same variable? I'm asking if PHP will let me, not whether it is possible to write the code like that. I know this would modify the variable inside the loop, and I'm not worried about that.</p>