Why echo $var is different
<pre><code>&lt;?php
function f(&amp; $var){$var = rand(); return $var;}
echo f($var ="a_").'&lt;br/&gt;'; /* outpu a random number */
echo $var.'&lt;br/&gt;'; /*but don't change global variables, it still is "1&lt;br/&gt;", no the same like up line */
echo f($var).'&lt;br/&gt;'; /* outpu a random number */
echo $var.'&lt;br/&gt;'; /* haved change, the same like up line */
?&gt;
</code></pre>

<p><em>run up code and output  text like under block</em></p>

<blockquote>
  <p>28486<br>
  a_<br>
  25863<br>
  25863</p>
</blockquote>

<p>Wwhy can't change the <code>$var</code> in the first call?</p>

<pre><code>&lt;?php
function f(&amp; $var, &amp; $isRefer){$var = rand(); global $gVar; var_dump(array('are they same?' =&gt; $isRefer === $gVar)); return $var;}
$gVar = 'global var';
echo f($var ="a_", $gVar = &amp; $gVar).'&lt;br/&gt;'; /* outpu a random number */
echo $var.'&lt;br/&gt;'; /*but don't change global variables, it still is "1&lt;br/&gt;", no the same like up line */
echo f($var, $gVar).'&lt;br/&gt;'; /* outpu a random number */
echo $var.'&lt;br/&gt;'; /* haved change, the same like up line */
?&gt;
</code></pre>

<p>-the code output like-</p>

<blockquote>
  <p>array(1) {
    ["are they same?"]=>
    bool(true)
  }
  14802
  a_
  array(1) {
    ["are they same?"]=>
    bool(true)
  }
  19107
  19107</p>
</blockquote>

<p><strong>so i think it is pass value like <code>f($var = 'd')</code> by "refer"</strong></p>
