PHP - Make reference parameter optional?
<p>Say I've defined a function in PHP, and the last parameter is passed by reference.  Is there any way I can make that optional? How can I tell if it's set?</p>

<p>I've never worked with pass-by-reference in PHP, so there may be a goofy mistake below, but here's an example:</p>

<pre><code>$foo;
function bar($var1,&amp;$reference)
{
    if(isset($reference)) do_stuff();
    else return FALSE;
}

bar("variable");//reference is not set
bar("variable",$foo);//reference is set
</code></pre>
