Add curl_multi_fdset to PHP cURL extension
Abierto
@krakjoe ya está trabajando en esto.
Desde el 30/8/2025.
Extension: curl
Feature
Status: Verified
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.1k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
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);
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Evaluación
Este issue todavía no se ha evaluado.