title: PHP Pass by reference error after using same var
body: <p>Take a look to this code, and help me to understand the result</p>
  
  <pre><code>$x = array('hello', 'beautiful', 'world');
  $y = array('bye bye','world', 'harsh');
  
  foreach ($x as $n =&gt; &amp;$v) { }
  
  $v = "DONT CHANGE!";
  
  foreach ($y as $n =&gt; $v){ }
  
  print_r($x);
  die;
  </code></pre>
  
  <p>It prints:</p>
  
  <pre><code>Array
  (
      [0] =&gt; hello
      [1] =&gt; beautiful
      [2] =&gt; harsh
  )
  </code></pre>
  
  <p>Why it changes the LAST element of the $x? it just dont follow any logic!</p>