Is it possible to account/trap missing arguments in functions?

For instance, say I have a function foo:

function foo($arg1,$arg2) { blah }

If someone calls that function as:

foo($arg1);

Can I somehow code around the fact that $arg2 is missing?  I've tried:

function foo($arg1,$arg2) {
    if (!isset($arg2) { $arg2=0 }
}

But that doesn't work.  However, that's the sort of functionality I'm looking 
for -- is there a way to do it?

Thanks.

--kurt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to