title: Ampersand before a variable in foreach php
body: <p>I have seen an ampersand symbol before a variable in foreach. I know the ampersand is used for fetching the variable address which is defined earlier.</p>
  
  <p>I have seen a code like this:</p>
  
  <pre><code>&lt;?php
  $arr = array(1, 2, 3, 4);
  foreach ($arr as &amp;$value) {
      $value = $value * 2;
  }
  
  // $arr is now array(2, 4, 6, 8)
  unset($value); // break the reference with the last element
  
  ?&gt;
  </code></pre>
  
  <p>I just need to know the use of &amp; before $value. I haven't seen any variable declared before to fetch the variable address.</p>
  
  <p>Please help me why its declared like this. Any help would be appreciated.</p>