curl_getinfo
Function • Params and return types changed in PHP 8.0
Get information regarding a specific transfer.
curl_getinfo
Function synopsis
curl_getinfo(CurlHandle $handle, ?int $option = null): mixed
Parameters
$handle
TypeCurlHandle
$option
OptionalType?int
Default valuenull
One of the CURLINFO_*
constants.
$option
accepts one of the following constant values:
CURLINFO_REDIRECT_URL
CURLINFO_PRIMARY_IP
CURLINFO_PRIMARY_PORT
CURLINFO_LOCAL_IP
CURLINFO_LOCAL_PORT
CURLINFO_RESPONSE_CODE
CURLINFO_HTTP_CONNECTCODE
CURLINFO_HTTPAUTH_AVAIL
CURLINFO_PROXYAUTH_AVAIL
CURLINFO_OS_ERRNO
CURLINFO_NUM_CONNECTS
CURLINFO_SSL_ENGINES
CURLINFO_COOKIELIST
CURLINFO_FTP_ENTRY_PATH
CURLINFO_APPCONNECT_TIME
CURLINFO_CERTINFO
CURLINFO_CONDITION_UNMET
CURLINFO_RTSP_CLIENT_CSEQ
CURLINFO_RTSP_CSEQ_RECV
CURLINFO_RTSP_SERVER_CSEQ
CURLINFO_RTSP_SESSION_ID
CURLINFO_EFFECTIVE_URL
CURLINFO_HTTP_CODE
CURLINFO_HEADER_SIZE
CURLINFO_REQUEST_SIZE
CURLINFO_TOTAL_TIME
CURLINFO_NAMELOOKUP_TIME
CURLINFO_CONNECT_TIME
CURLINFO_PRETRANSFER_TIME
CURLINFO_SIZE_UPLOAD
CURLINFO_SIZE_DOWNLOAD
CURLINFO_SPEED_DOWNLOAD
CURLINFO_SPEED_UPLOAD
CURLINFO_FILETIME
CURLINFO_SSL_VERIFYRESULT
CURLINFO_CONTENT_LENGTH_DOWNLOAD
CURLINFO_CONTENT_LENGTH_UPLOAD
CURLINFO_STARTTRANSFER_TIME
CURLINFO_CONTENT_TYPE
CURLINFO_REDIRECT_TIME
CURLINFO_REDIRECT_COUNT
CURLINFO_HEADER_OUT
CURLINFO_PRIVATE
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
CURLINFO_CONTENT_LENGTH_UPLOAD_T
CURLINFO_SIZE_DOWNLOAD_T
CURLINFO_SIZE_UPLOAD_T
CURLINFO_SPEED_DOWNLOAD_T
CURLINFO_SPEED_UPLOAD_T
CURLINFO_FILETIME_T
CURLINFO_APPCONNECT_TIME_T
CURLINFO_CONNECT_TIME_T
CURLINFO_NAMELOOKUP_TIME_T
CURLINFO_PRETRANSFER_TIME_T
CURLINFO_REDIRECT_TIME_T
CURLINFO_STARTTRANSFER_TIME_T
CURLINFO_TOTAL_TIME_T
CURLINFO_LASTONE
CURLINFO_PROTOCOL
CURLINFO_SCHEME
CURLINFO_HTTP_VERSION
CURLINFO_PROXY_SSL_VERIFYRESULT
CURLINFO_EFFECTIVE_METHOD
Return value
Typemixed
If $option
is given, returns its value.
Otherwise, returns an associative array with the following elements
(which correspond to $option
), or false
on failure:
Note that private data is not included in the associative array and must be retrieved individually with the CURLINFO_PRIVATE
option.
Changes to the curl_getinfo
Function
PHP 8.0
- Return type added:
mixed
- Parameter name of parameter #1 changed:
$ch
to$handle
- Parameter type added for parameter #1 (
$handle
):CurlHandle
- Parameter type added for parameter #2 (
$option
):?int
- Parameter default value added for position #2 (
$option
):null
- curl_getinfo($ch, $option)
+ curl_getinfo(CurlHandle $handle, ?int $option = null): mixed
curl_getinfo
Function Availability
curl_getinfo
Function AvailabilityPHP Version | Availability |
---|---|
PHP 8.5Future Release | Yes |
PHP 8.4Upcoming Release | Yes |
PHP 8.3Supported (Latest) | Yes |
PHP 8.2Supported | Yes |
PHP 8.1Security-Fixes Only | Yes |
PHP 8.0Unsupported | Yes |
PHP 7.4Unsupported | Yes |
PHP 7.3Unsupported | Yes |
PHP 7.2Unsupported | Yes |
PHP 7.1Unsupported | Yes |
PHP 7.0Unsupported | Yes |
PHP 5.6Unsupported | Yes |
PHP 5.5Unsupported | Yes |
PHP 5.4Unsupported | Yes |
PHP 5.3Unsupported | Yes |