From 653dc41a26bd34f06bae25ab89532df938e8c9c5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 1 Aug 2022 19:57:53 +0200 Subject: [PATCH] [HttpClient] Fix shared connections not being freed on PHP < 8 --- Internal/CurlClientState.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Internal/CurlClientState.php b/Internal/CurlClientState.php index 5821f67..904cc47 100644 --- a/Internal/CurlClientState.php +++ b/Internal/CurlClientState.php @@ -96,7 +96,7 @@ public function reset() curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_DNS); curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_SSL_SESSION); - if (\defined('CURL_LOCK_DATA_CONNECT')) { + if (\defined('CURL_LOCK_DATA_CONNECT') && \PHP_VERSION_ID >= 80000) { curl_share_setopt($this->share, \CURLSHOPT_SHARE, \CURL_LOCK_DATA_CONNECT); } }