Please look at the following two codes.
Code 01
test_function($user_name, $user_email, $user_status, $another)
function test_function($user_name, $user_email, $user_status, $another){
//Do What You Want
}
Code 02
$pass_data = array(
"user_name"=>$user_name,
"user_email"=>$user_email,
"user_status"=>$user_status,
"another"=>$another,
);
test_function($pass_data)
function test_function($pass_data){
//Do What You Want
}
When I am using Code 01, if I want to add another variable I want to change both headers. sometimes I feel like code also unclear when there are many parameters. .
So I thought to use the second way. But I have not seen that programmers generally use the second way in all their codes.
So what are the disadvantages using Code 02? That means, passing array to function instead of separate values.
extractphp.net/manual/de/function.extract.php is being used in conjunction with it.