-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
curl_close() is noop since 8.0.0 and emites E_DEPRECATED since 8.5.0.
It's used in Monolog\Handler\Curl\Util::execute() if $closeAfterDone = true.
It's the same for 1.x, 2.x and 3.x.
On 3.x we could just drop the $closeAfterDone parameter, but that might lead to backport difficulties.
One suggestion would be to check PHP_VERSION_ID on the top of the affected function:
// src/Monolog/Handler/Curl/Util.php
public static function execute(CurlHandle $ch, int $retries = 5, bool $closeAfterDone = true): bool|string
{
if (\PHP_VERSION_ID >= 80000) {
$closeAfterDone = false;
}
// ...
}This would retain similar code in all branches until old versions are dropped.