|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77264 curl_getinfo returning microseconds, not seconds
Submitted: 2018-12-07 18:56 UTC Modified: 2018-12-08 21:41 UTC
From: chris at lodesys dot com Assigned: pierrick (profile)
Status: Closed Package: cURL related
PHP Version: 7.3.0 OS: Windows
Private report: No CVE-ID: None
 [2018-12-07 18:56 UTC] chris at lodesys dot com
Under PHP 7.3.0, cURL appears to be returning times in microseconds instead of seconds.

Running PHP executables downloaded from from

The following example is from the curl_getinfo documentation page --

Test script:
// Create a cURL handle
$ch = curl_init('');

// Execute

// Check if any error occurred
if (!curl_errno($ch)) {
  $info = curl_getinfo($ch);
  echo 'Took ', $info['total_time'], ' seconds to send a request to ', $info['url'], "\n";

// Close handle

Expected result:
The expected result is less than 0.5 seconds "to send a request". 

This is what I'm seeing when running this script with PHP 7.2.12 

Actual result:
I'm getting values like 110000 seconds "to send a request" (30.5 hours).

Same script run with PHP 7.3.0

Have the same microseconds-not-seconds problem with all the time values



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-08 10:34 UTC]
-Status: Open +Status: Verified -Package: HTTP related +Package: cURL related -Assigned To: +Assigned To: pierrick
 [2018-12-08 10:34 UTC]
If libcurl ≥ 7.61.0 is available, the times are indeed given as
int in microseconds[1]; for older libcurl they are floats in
seconds[2].  Is this intentional, Pierrick?  If so, we have to
prominently document the change in UPGRADING and the migration
guide etc.  However, it might be better to introduce new array
elements (e.g. total_time_us) instead of overwriting the old ones
for BC reasons.

[1] <>
[2] <>
 [2018-12-08 15:42 UTC]
Sorry about this I went to fast. It's my mistake. I'll commit a fix for this soon.
 [2018-12-08 21:41 UTC]
-Status: Verified +Status: Closed
 [2018-12-08 21:41 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Mar 04 08:01:28 2024 UTC