php-http / curl-client

cURL client
http://httplug.io
MIT License
443 stars 28 forks source link

PHP 8: Add support for CurlHandle resource objects #70

Closed Ayesh closed 3 years ago

Ayesh commented 3 years ago
Q A
Bug fix? yes
New feature? no yes
BC breaks? no yes
Deprecations? no yes
Related tickets fixes #X, partially #Y, mentioned in #Z
Documentation if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation
License MIT

What's in this PR?

In PHP 8.0, Curl resources are changed to CurlHandle class objects. This changes DocBlock parameters and other areas where provided handles are checked with is_resource(), which now needs to account for the replaced CurlHandle class objects.

Why?

Because in PHP 8.0, Curl handles are no longer resources, and this libraries is_resource no longer return true for valid Curl handlers.

Example Usage

is_resource(curl_init()); // true in PHP < 8.0
is_resource(curl_init()); // false in PHP >= 8.0

Checklist