-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Description
Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0
How to reproduce
Run any query against ClickHouse on PHP 8.5:
$client = new ClickHouseDB\Client(['host' => 'localhost']);
$client->select('SELECT 1');
// E_DEPRECATED: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0Suggested fix
Remove the curl_close() call entirely — it's been a no-op since PHP 8.0. If backward compatibility with PHP 7.x is needed, guard it:
public function close()
{
if ($this->handle) {
- curl_close($this->handle);
+ if (PHP_VERSION_ID < 80000) {
+ curl_close($this->handle);
+ }
}
$this->handle = null;
}Or simply:
public function close()
{
- if ($this->handle) {
- curl_close($this->handle);
- }
$this->handle = null;
}References
- https://php.watch/versions/8.5/curl_close-curl_share_close-deprecated
- https://wiki.php.net/rfc/deprecations_php_8_5
Environment
- PHP 8.5.2
- smi2/phpclickhouse 1.6.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels