diff --git a/lib/RequestClient/CurlRequestClient.php b/lib/RequestClient/CurlRequestClient.php index 581249df..75b15770 100644 --- a/lib/RequestClient/CurlRequestClient.php +++ b/lib/RequestClient/CurlRequestClient.php @@ -113,14 +113,18 @@ private function execute($opts) if ($result === false) { $errno = \curl_errno($curl); $msg = \curl_error($curl); - \curl_close($curl); + if (PHP_VERSION_ID < 80000) { + \curl_close($curl); + } throw new GenericException($msg, ["curlErrno" => $errno]); } else { // Unsure how versions of cURL and PHP correlate so using the legacy // reference for getting the last response code $statusCode = \curl_getinfo($curl, \CURLINFO_RESPONSE_CODE); - \curl_close($curl); + if (PHP_VERSION_ID < 80000) { + \curl_close($curl); + } return [$result, $headers, $statusCode]; }