title: In PHP, what's the diff : $var2=$var1 ; $var2=&$var1;
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1768343/reference-assignment-operator-in-php">Reference assignment operator in php =&amp;</a>  </p>
  </blockquote>
  
  
  
  <pre><code>$var2 = $var1;
  $var2 = &amp;$var1;
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>$GLOBALS['a']=1;
  
  
  function test()
  {
      global $a;
      $local=2;
      $a=&amp;$local;
  }
  
  
  test();
  
  echo $a;
  </code></pre>
  
  <p>Why is $a still 1 ?</p>