func_get_args() return the arguments passed to a function. Since named parameters are supported in PHP8, is there a way to get the arguments as a hash instead of an array?
That is
function x(string $firstName, string $middleInitial) {
return func_get_args();
}
x('John', 'J'); // returns ['John','J']
x(middleInitial: 'J', firstName: 'John'); // returns ['John','J']
// is there a way to get ['firstName' => 'John, 'middleInitial' => 'J']