func_get_args() parameter list usage

php

Solution

Prior to 5.3 it was impossible to do this:

function foo($a,$b)
{
   var_dump(func_get_args());
}

In order to retrieve a function's arguments (i.e. for debugging purposes), you had to assign `func_get_args` return value to a variable before the actual value could be used:

function foo($a,$b)
{
    $args = func_get_args();
    var_dump($args);
}

Using the immediate return value of `func_get_args` (without a temporary variable) is possible as of PHP 5.3.

Problem

PHP's `func_get_args()` docs mention: This function can now be used in parameter lists. Can anyone explain what that means and how to apply it?

Original source