From 187672cde1c5befc1f97f67ebef77e3ae2ccb507 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 22 Nov 2025 19:42:18 +0100 Subject: [PATCH] Fix deprecations triggered by PHP 8.5 The `curl_close` function is a no-op as of PHP 8.0 (when the curl extension migrated from resources to objects) and is deprecated as of PHP 8.5. --- lib/WebDriver/Service/CurlService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/WebDriver/Service/CurlService.php b/lib/WebDriver/Service/CurlService.php index 1462fb5..10e0c8c 100755 --- a/lib/WebDriver/Service/CurlService.php +++ b/lib/WebDriver/Service/CurlService.php @@ -89,7 +89,9 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions CURLE_GOT_NOTHING !== ($errno = curl_errno($curl)) && $error = curl_error($curl) ) { - curl_close($curl); + if (\PHP_VERSION_ID < 80000) { + curl_close($curl); + } $e = new CurlExecException( sprintf( @@ -106,8 +108,9 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions throw $e; } - - curl_close($curl); + if (\PHP_VERSION_ID < 80000) { + curl_close($curl); + } return array($rawResult, $info); }