mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
![]() The `phpinfo()` section of the Curl extension lists individual features supported by the particular ext-Curl + libcurl build. However, the `curl_version()` function return values do not indicate the same level of details. `curl_version()` has a `protocols` key that returns an array of all protocols supported by the build. But the `features` key is a bitmask of all the features. Checking the availability of certain feature requires knowing the corresponding `CURL_VERSION` constant, and checking the availability of the constant and a bitmask check for it in the `features` value. For example, to determine HTTP2 support, it requires evaluating: ```php defined('CURL_VERSION_HTTP2') && (curl_version()['features'] & CURL_VERSION_HTTP2 === CURL_VERSION_HTTP2) ``` To make feature availability checks more intuitive, this adds a new `feature_list` key to `curl_version()` output array. With it, checking for individual features availability is easier, and does not require inspecting the availability of the `CURL_VERSION` constant and the `features` key. ```php !empty(curl_version()['feature_list']['HTTP2']); ``` |
||
---|---|---|
.. | ||
tests | ||
config.m4 | ||
config.w32 | ||
CREDITS | ||
curl.stub.php | ||
curl_arginfo.h | ||
curl_file.c | ||
curl_file.stub.php | ||
curl_file_arginfo.h | ||
curl_private.h | ||
interface.c | ||
multi.c | ||
php_curl.h | ||
share.c | ||
sync-constants.php |