Skip to content

Commit 73ab961

Browse files
committed
Fix E_DEPRECATED messages when running against PHP 8.5
Fixes #448
1 parent 77309b6 commit 73ab961

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

source/CAS/Request/CurlMultiRequest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ public function send ()
139139
$buf = curl_multi_getcontent($handles[$i]);
140140
$request->_storeResponseBody($buf);
141141
curl_multi_remove_handle($multiHandle, $handles[$i]);
142-
curl_close($handles[$i]);
142+
if (PHP_VERSION_ID < 80000) {
143+
curl_close($handles[$i]);
144+
} else {
145+
// unreference it => it will be closed
146+
unset($handles[$i]);
147+
}
143148
}
144149

145150
curl_multi_close($multiHandle);

source/CAS/Request/CurlRequest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ protected function sendRequest ()
8686

8787
}
8888
// close the CURL session
89-
curl_close($ch);
89+
if (PHP_VERSION_ID < 80000) {
90+
curl_close($ch);
91+
}
9092

9193
phpCAS::traceEnd($res);
9294
return $res;

0 commit comments

Comments
 (0)