You can use the array spread syntax to pass an array of arguments to another function

You can use the array spread syntax to pass an array of arguments to another function

🔥 You can use array spreading to pass an array as arguments to another function. #php

Here’s a self-contained example where we spread the array output of sys_getloadavg. That function returns an array with three elements.

https://github.com/spatie/cpu-load-health-check/blob/70f387d5167c24d4000d825a5bddab2504d557fb/src/CpuLoad.php#L17

#php

We're writing a book, you can get it for free here.