mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
17 lines
741 B
Markdown
17 lines
741 B
Markdown
---
|
||
title: 'You can use the array spread syntax to pass an array of arguments to another function'
|
||
tweet_id: '1471864644562305025'
|
||
thread_slug: weekly-thread-2021-50
|
||
author_username: freekmurze
|
||
images:
|
||
- 'https://pbs.twimg.com/media/FGepj8mWQAUf2R_.jpg'
|
||
created_at: 2021-12-17T15:27:31+00:00
|
||
slug: 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
|