title: How to determine if a pass-by-reference variable is set?
body: <p>For an arbitrary function declared as follows:</p>
  
  <pre><code>function foo($first, &amp;$second = null) {
      // if ($second is assigned) {
      //     Work with $second
      // }
  }
  </code></pre>
  
  <p>How does one determine if <code>$second</code> is indeed assigned to a variable at call time, eg.:</p>
  
  <pre><code>foo('hello', $second);
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>foo('hello'); // Notice &amp;$second is unassigned
  </code></pre>
  
  <p>Tried <code>isset()</code>, <code>is_null()</code> but they don't seem to work.</p>
  
  <h3>Update:</h3>
  
  <p>Created a <a href="http://codepad.org/HHaVoXrc" rel="nofollow">test script here</a> here</p>