diff --git a/lib/Consumer/LibCurl.php b/lib/Consumer/LibCurl.php index 405467b..e5dca53 100644 --- a/lib/Consumer/LibCurl.php +++ b/lib/Consumer/LibCurl.php @@ -74,8 +74,11 @@ public function flushBatch(array $messages): bool $responseCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE); - //close connection - curl_close($ch); + // This function has no effect. Prior to PHP 8.0.0, this function was used to close the resource. + // @link https://www.php.net/manual/en/function.curl-close.php + if (PHP_VERSION_ID < 80000) { + curl_close($ch); + } if ($responseCode !== 200) { // log error