在php中读取函数参数的最佳方法是什么?

In the past few years I've used this formula to read parameters in my methods inside my php classes:

$params = func_get_args();
if(is_array($params[0])){
    foreach($params[0] as $key => $value){
        ${$key} = $value;
    }
}

And it works fine, as if I pass something like this:

$class->foo(array('bar' => 'hello', 'planet' => 'world'));

I will have in my foo method the variables bar and planet with their relative values. But what I'm asking is: Is there any better way to do it? Something that maybe I can encapsulate in another method for example?

UPDATE

So, taking in consideration rizier123 comment, and after a chat with a friend of mine, I nailed down what I think is the better way pass parameters to function. As I know that I will always pass just one parameter to the function, which is always going to be an array, there's no need to call the func_get_args() function, but I better to expect an array all the time and by default I set an empty array, like in the following example:

class MyClass{
    public function MyMethod(array $options = array()){            
        extract($options);             
    }
}

$my = new MyClass();
$my->MyMethod(array('name' => 'john', 'surname' => 'doe'));
// Now MyMethod has two internal vars called $name and $surname

Yes you can use extract() to convert your arrays to variables, like this:

extract($params[0]);

You can do this with PHP built-in function extract().

Use it this way:

$var_array = array("color" => "blue",
                   "size"  => "medium",
                   "shape" => "sphere");
extract($var_array);

When you run echo $color, $size, $shape; it outputs:

blue, medium, sphere

There is a new feature from PHP 5.6, it's called Variadic functions http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list

function foo(...$arguments) {
    foreach ($arguments as $arg) {
        var_dump($arg);
    }
}

foo('1', 2, true, new DateTime('now'));