Add curl_multi_fdset to PHP cURL extension
Offen
@krakjoe arbeitet bereits daran.
Seit 30.8.2025.
Extension: curl
Feature
Status: Verified
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
The binding for curl_multi_fdset() (available in libcurl C API) is missing.
This creates a limitation:
- In libcurl (C), developers can extract the underlying sockets and integrate them into a single event loop with other file descriptors (e.g. database sockets, custom UDP/TCP sockets, message queues, etc.) using select(), poll(), or epoll().
- In PHP, it is not possible: we only have curl_multi_select(), which is isolated and works exclusively for cURL sockets.
Many PHP applications combine multiple asynchronous sources:
- HTTP requests via cURL multi-handle
- Database connections (PostgreSQL via pg_socket())
- Custom sockets (e.g. UDP for inter-process communication)
Proposed:
curl_multi_fdset(CurlMultiHandle $mh, array &$read, array &$write, array &$except): int
Where:
$read, $write, $except are arrays of PHP stream resources corresponding to the fds returned by libcurl.
Return value is the max_fd (as in libcurl).
Example:
$read = [$pg_socket, $udp_socket];
$write = [];
$except = [];
curl_multi_fdset($mh, $read, $write, $except);
stream_select($read, $write, $except, $timeout);
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.