What is the best way to define a method signature when you have to pass many values to a function and some of these may be optional. And in future, May be I have to pass more variables or subtract some passed values given to function.
For example: (phone and address are optional)
function addInfo( $name, $dob, $phone='', $address='' ) {
// Store data
}
addInfo( 'username', '01-01-2000', '1111111' ); // address is not given
OR
function addInfo( $info ) {
// Store data
}
$info = array( 'name'=>'username',
'dob'=>'01-01-2000',
'phone'=>'1111111',
'address'=>'' );
addInfo( $info );