php8.5
Home/ Manual/ curl / functions/ curl_multi_select

curl_multi_select

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Wait until reading or writing is possible for any cURL multi handle connection

Description

curl_multi_select(CurlMultiHandle $multi_handle, float $timeout = 1.0): int

Blocks the execution of the script until a cURL handle attached to the cURL multi handle would be able to make progress on the next call to curl_multi_exec() or until the timeout strikes (whichever comes first).

Parameters

timeout

Time, in seconds, to wait for a response from the active cURL multi handle connections.

Return Values

On success, returns the number of active descriptors contained in the descriptor sets. This may be 0 if there was no activity on any of the descriptors. On failure, this function will return -1 on a select failure (from the underlying select() system call).

Errors/Exceptions

Throws a ValueError if timeout is less than 0 or greater than PHP_INT_MAX.

Changelog

VersionDescription
8.4.0Now throws a ValueError if timeout is less than 0 or greater than PHP_INT_MAX.

See Also

Source: reference/curl/functions/curl-multi-select.xml · from the official PHP manual (php/doc-en)