I am an apologist of clean and readable code, therefore I find that a lot of arguments passed to functions usually do mean nothing, and people need to go through the functions to understand what they are doing and receiving.
Per example:
<?php
function hi($name, $age, $description) {
echo $name . ' - ' . $age . ' - ' . $description;
}
hi('John', 21, 'I\'m a builder');
?>
Should something like this be a better approach?
<?php
function hi($options) {
echo $options['name'] . ' - ' . $options['age'] . ' - ' . $options['description'];
}
hi(array(
'name' => 'John',
'age' => 21,
'description' => 'I\'m a builder'
));
?>
What is your opinion on this?