[php-src] PR #19147: Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo()
| From: | thecaliskan | Date: | Wed, 16 Jul 2025 10:56:56 +0000 |
| Subject: | [php-src] PR #19147: Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-32470@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/19147
Author: thecaliskan
# Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo()
## Summary
This patch adds support for the
CURLINFO_QUEUE_TIME_T constant in the
curl_getinfo() function when compiled with **libcurl >= 8.6.0**.
CURLINFO_QUEUE_TIME_T This constant allows retrieving the time (in microseconds) that
the request spent in libcurl’s connection queue before it was sent.
[Source](https://curl.se/libcurl/c/CURLINFO_QUEUE_TIME_T.html)
---
## Details
- Introduced support for curl_getinfo($ch, CURLINFO_QUEUE_TIME_T) when available.
- Added "queue_time_us" key to the associative array returned by
curl_getinfo($ch) if applicable.
- A SKIPIF check ensures that the test is skipped if the libcurl version is too old.
- Includes a .phpt test file:
ext/curl/tests/curl_getinfo_CURLINFO_QUEUE_TIME_T.phpt.
---
## Requirements
- Requires **libcurl version 8.6.0 or higher**.
- PHP runtime will fallback silently if the constant is not available in the underlying libcurl.
---
## Example usage
```php
$ch = curl_init("https://example.com");
curl_exec($ch);
$queueTime = curl_getinfo($ch, CURLINFO_QUEUE_TIME_T);
echo "Queue Time: $queueTime\n";
```
## [CURL Times](https://curl.se/libcurl/c/curl_easy_getinfo.html)
An overview of the time values available from
[curl_easy_getinfo](https://curl.se/libcurl/c/curl_easy_getinfo.html)
[curl_easy_perform](https://curl.se/libcurl/c/curl_easy_perform.html)()
|
|--QUEUE
|--|--NAMELOOKUP
|--|--|--CONNECT
|--|--|--|--APPCONNECT
|--|--|--|--|--PRETRANSFER
|--|--|--|--|--|--POSTTRANSFER
|--|--|--|--|--|--|--STARTTRANSFER
|--|--|--|--|--|--|--|--TOTAL
|--|--|--|--|--|--|--|--REDIRECT