Variable-length function arguments using spread token in PHP

1 · Amit Merchant · May 11, 2021, 8:08 p.m.
When working with functions, there might come the scenario where you’re unsure as to how many arguments a function would have. Basically, a function can have an unlimited number of arguments that you don’t define in the function signature. For instance, a function that takes multiple strings as its arguments and counts the sum of words from all the specified strings. But there’s no limit on how many strings you could provide to the function. So, the calling function could look like so. wordCount...