How does "&" operator work in PHP function?
<p>Please see this code.</p>

<pre><code>function addCounter(&amp;$userInfoArray) {
    $userInfoArray['counter']++;
    return $userInfoArray['counter'];
}

$userInfoArray = array('id' =&gt; 'foo', 'name' =&gt; 'fooName', 'counter' =&gt; 10);
$nowCounter = addCounter($userInfoArray);

echo($userInfoArray['counter']);
</code></pre>

<p>This will show 11.</p>

<p>But! If you remove "&amp;"operator in the function parameter, the result will be 10.</p>

<p>I don't know what's going on. Please explain it to me. Thank you.</p>
