Using PHP 8, call_user_func_array call callback function using named arguments if an array with keys is passed to $args parameter, if the array used has only values, arguments are passed positionally.
<?php
function test(string $param1, string $param2): void
{
echo $param1.' '.$param2;
}
$args = ['hello', 'world'];
call_user_func_array('test', $args);
$args = ['param2' => 'world', 'param1' => 'hello'];
call_user_func_array('test', $args);
$args = ['unknown_param' => 'hello', 'param2' => 'world'];
call_user_func_array('test', $args);
?>