I wanna define a function in PHP with a header like this:
public function functionname(Classname $node)
{ ... }
but $node can also be NULL
when I pass NULL i get:
Catchable fatal error: Argument 1 passed to functionname() must be an instance of Classname, null given, called in phpfile.php on line xx and defined in ...
Is it possible somehow that php also lets me pass a NULL or a NULLpointer? or do i have to redefine the function like:
public function functionname($node)
and check inside with an:
if ($node != NULL)
if (typeof($node)!="Classname")
{ throw error }