Closed klippo closed 5 years ago
A better solution is to initialise the $handles
property as an array.
This appears to be a class pulled from some other vendor, maybe it needs to be updated?
Casting 'handles' to array also seems to work.
--- Client.php.orig 2019-06-13 11:45:35.361486290 -0600
+++ Client.php 2019-06-13 11:44:46.978109913 -0600
@@ -177,7 +177,7 @@
curl_getinfo($ch, CURLINFO_HTTP_CODE), $handle->responseHeaders, $handle->responseBody
);
- if (count($this->handles) >= self::MAX_HANDLES) {
+ if (count((array) $this->handles) >= self::MAX_HANDLES) {
curl_close($ch);
} else {
curl_reset($ch);
Initialize with $handles = []; would be indeed better - without checking the references.
But, it doesn't matter until someone is maintaining this repo. There are 2 or 3 issues for this and at least 1 pull request.
This extension deserves better, since it's working quite nice. But this minor error destroys a lot of the user experience.
There is a problem getting results when using PHP 7.2
After doing a quick google search I tested the following change with success, with limited knowledge of the code I don't want to submit a PR.
Versions: