I made a function like this (no need to write the whole function here) :
public function selectNode($from, $attributes = null, $childs = null)
and, of course, if I call it this way :
$node->selectNode();
The argument $from isn’t initialized and then you got a warning error.
I know you can suppress the error doing @$node->selectNode(); or something like that thanks to @.
But, I want to handle it myself. How can I do that if that’s possible?
The only way I found is to initialize it like this public function selectNode($from = null, $attributes = null, $childs = null) but that doesn’t make it clear ($from is not an option as the others).
(And, of course, this function, here, is just an example. It could be extended to other functions)
You could use a try-catch block handling the error yourself.