I'm working on a simple class right now to get my head around OOP and I need some help with a function. The function receives various parameters, some of are optional:
public function Test($req, $alsoreq, $notreq = null, $notreq2 = null, $notreq3 = null)
{
...
}
How do I call the function, passing the two first parameters and the last one?
For example:
Test('req', 'alsoreq', 'notreq3');
Ignoring the notreq2
and notreq
?
I tried
Test('req', 'alsoreq', '', '', 'notreq3');
but this seems ugly and hackish.