Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() #19147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
bukka merged 14 commits into php:master from thecaliskan:added-curlinfo-queue-time-t
Jul 17, 2025

Conversation

Copy link
Contributor

@thecaliskan thecaliskan commented Jul 16, 2025

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


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

$ch = curl_init("https://example.com");
curl_exec($ch);
$queueTime = curl_getinfo($ch, CURLINFO_QUEUE_TIME_T);
echo "Queue Time: $queueTime\n";

CURL Times

An overview of the time values available from curl_easy_getinfo

curl_easy_perform()
|
|--QUEUE
|--|--NAMELOOKUP
|--|--|--CONNECT
|--|--|--|--APPCONNECT
|--|--|--|--|--PRETRANSFER
|--|--|--|--|--|--POSTTRANSFER
|--|--|--|--|--|--|--STARTTRANSFER
|--|--|--|--|--|--|--|--TOTAL
|--|--|--|--|--|--|--|--REDIRECT

Copy link
Member

@Ayesh Ayesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @thecaliskan @devnexen. Looks good!

CURLINFO_QUEUE_TIME_T is the last TIME Curl-info const we did not have in ext/curl. I'm glad we are closing this gap.

thecaliskan reacted with hooray emoji thecaliskan reacted with heart emoji
thecaliskan and others added 2 commits July 16, 2025 18:36
Copy link
Contributor Author

Hi @bukka

Could you check this PR ?

@bukka bukka merged commit 7fb6afb into php:master Jul 17, 2025
8 of 9 checks passed
Copy link
Member

bukka commented Jul 17, 2025

Thanks for the contribution! For the record the NEWS updated in a8a3c81

thecaliskan reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@bukka bukka bukka approved these changes

@Ayesh Ayesh Ayesh approved these changes

@kocsismate kocsismate Awaiting requested review from kocsismate kocsismate is a code owner

@adoy adoy Awaiting requested review from adoy adoy is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /