Let's take a look at this typical PHP code: function names() { $data = Http::get('data.location/products')->json(); $names = []; foreach ($data as $item){ $names[] = $item['name']; } return $names; } We send an HTTP request that returns an array of items, then we store the name of each item in a $names array. Executing this function will take time that's equal to the duration of the request plus the time it took to build the array.

In other words, the available cores will switch between processing our two processes and other processes.

So if we break down our code, it comes to this: go(function(){ $data = Http::get('data.location/products')->json(); // yields foreach(..).
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners