title: Pass a variable to a PHP function, even if undefined
body: <p>I discovered something that could clean up my code but I wanted to see ask the community to ensure this is not a loophole/bug.</p>
  
  <p>Ok I have a config class like this</p>
  
  <pre><code>$this-&gt;config-&gt;items
  </code></pre>
  
  <p>I want to initiate another class that may have a config element or it may not. I understand there are a couple of ways to do this:</p>
  
  <pre><code>if(isset($this-&gt;config-&gt;xxxx)){
      return new SomeClass($this-&gt;config-&gt;xxxx);
  } else {
      return new SomeClass();
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$config = ! empty($this-&gt;config-&gt;xxxx) ? $this-&gt;config-&gt;xxxx : null;
  return new SomeClass($config);
  </code></pre>
  
  <p>but I found out the following works great, just not sure if safe to use... AKA not how the compiler should work and will be patched.</p>
  
  <pre><code>return new SomeClass($c =&amp; $this-&gt;config-&gt;xxxx);
  </code></pre>
  
  <p>I am using PHP 5.6.3 and the above works great and bench marks are negligible. From my understanding of PHP this is a valid way to do things but just wanted to make sure I was not missing anything. Any insight on this would be appreciated.</p>