It may be hackish to some, but I learned this way from how Cakephp does some functions and have adapted it because I like the flexibility it creates
The idea is you have different type of arguments, arrays, objects etc, then you detect what you were passed and go from there
function($arg1, $lastname) {
if(is_array($arg1)){
$lastname = $arg1['lastname'];
$firstname = $arg1['firstname'];
} else {
$firstname = $arg1;
}
...
}