Python provides the \"*\" operator for unpacking a list of tuples and giving them to a function as arguments, like so:
args = [3, 6] range(*args)
You can use call_user_func_array() to achieve that:
call_user_func_array("range", $args); to use your example.
call_user_func_array("range", $args);