I mean, how do you pass your arguments to a function?
Do your user function call looks like this:
$this->getSomeNumber($firstArg, $secondArg, null);
or do you detect how many arguments was passed to the function and then do the job?
I wonder if is there any coding style covering this. And how do other programming languages handle this?
UPDATE
Example fot those, who not understand:
function doSmth($firstArgument) {
if(func_num_args() > 1) {
//do job if second argument was passed
}
}
Second example:
function doSmthElse($firstArgument, $secondArgument) {
if($secondArgument) {
//do job if second argument was passed
}
}
And then you call it like:
doSmth($var, $secondvar) or doSmth($var)
//**OR**
doSmthElse($var, $secondvar) or doSmthElse($var, null)
Which is better to use? I mean which do other programmers expect from you?