From 26ea1f88f3fb7bce7547f3f158c8224cf7123138 Mon Sep 17 00:00:00 2001 From: Matheus Eduardo Date: Fri, 17 Apr 2026 17:18:02 -0300 Subject: [PATCH] Conditionally close cURL handle for PHP versions < 8.5 function `curl_close` deprecated since PHP 8.5 --- src/Curl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Curl.php b/src/Curl.php index 3cc3df5..49fe905 100644 --- a/src/Curl.php +++ b/src/Curl.php @@ -358,7 +358,11 @@ public function handler(): bool \CURLOPT_PROGRESSFUNCTION => null ]); \curl_reset($this->curl); - \curl_close($this->curl); + + if (PHP_VERSION_ID < 80500) { + \curl_close($this->curl); + } + $this->curl = null; } return !empty($this->exec);