How to suppress error if an argument is missing in a function call?
<p>I made a function like this (no need to write the whole function here) : </p>

<pre><code>public function selectNode($from, $attributes = null, $childs = null)
</code></pre>

<p>and, of course, if I call it this way :</p>

<pre><code>$node-&gt;selectNode();
</code></pre>

<p>The argument <code>$from</code> isn't initialized and then you got a warning error.
I know you can suppress the error doing <code>@$node-&gt;selectNode();</code> or something like that thanks to <code>@</code>.</p>

<p>But, I want to handle it myself. <strong>How can I do that</strong> if that's possible?</p>

<p>The only way I found is to initialize it like this <code>public function selectNode($from = null, $attributes = null, $childs = null)</code> but that doesn't make it clear ($from is not an option as the others).</p>

<p>(And, of course, this function, here, is just an example. It could be extended to other functions)</p>
