From c056aaba3b3bc3c64a0486da4ea2666afc6b5c9a Mon Sep 17 00:00:00 2001 From: Anton Smirnov Date: Mon, 16 Feb 2026 17:50:33 +0200 Subject: [PATCH] curl_close and curl_multi_close are noop in PHP 8.0+ --- src/Http/CurlDispatcher.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Http/CurlDispatcher.php b/src/Http/CurlDispatcher.php index 6cdde3a1..0658c0fd 100644 --- a/src/Http/CurlDispatcher.php +++ b/src/Http/CurlDispatcher.php @@ -99,7 +99,9 @@ public static function fetch(array $settings, ResponseFactoryInterface $response curl_multi_remove_handle($multi, $curlHandle); } - curl_multi_close($multi); + if (PHP_VERSION_ID < 80000) { + curl_multi_close($multi); + } return array_map( fn ($connection) => $connection->getResponse($responseFactory), @@ -160,8 +162,10 @@ private function getResponse(ResponseFactoryInterface $responseFactory): Respons $this->error(curl_error($curlHandle), $errno); } - /** @phpstan-ignore argument.type (PHP 7.4/8.0 compatibility) */ - curl_close($curlHandle); + if (PHP_VERSION_ID < 80000) { + /** @phpstan-ignore argument.type (PHP 7.4/8.0 compatibility) */ + curl_close($curlHandle); + } $response = $responseFactory->createResponse($info['http_code']);