Passing by referencing with a function in php?
<p>I have a simple function like so which I use to compare something,</p>

<pre><code>function life($life) {
    while($life) {
        echo $life . '&lt;br /&gt;';
        --$life;
    }
    return $life;
}
$life = life($user['lifeforce']);
if($life) { ... }
</code></pre>

<p>Should I pass it by reference or forget it and use what I am using? Would it be better to do...</p>

<pre><code>function life(&amp;$life) {
    while($life) {
        echo $life . '&lt;br /&gt;';
        --$life;
    }
}
life($user['lifeforce']);
if($user['lifeforce']) { ... }
</code></pre>

<p>I am not quite understading the concepts of passing by reference?</p>

<p>Thanks</p>
