Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:124673
X-Original-To: internals@lists.php.net
Delivered-To: internals@lists.php.net
Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5])
	by qa.php.net (Postfix) with ESMTPS id 478701A00B7
	for <internals@lists.php.net>; Mon, 29 Jul 2024 10:20:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail;
	t=1722248545; bh=CjCiDJX7xCSL8iN6knnsRa4xOITjv0M+pGVvyOL6GJI=;
	h=Date:Subject:To:References:From:In-Reply-To:From;
	b=hPA/2wxpe1c8i48rGOK2HIOvDq2XeOzJIIn47qUeJXgmAWQgphoGNA+LHmNIVyKtP
	 puEfwMMI57OriIEHUbfDBqn2EoMfS1+T9mM4khfTIJvV0qpDjQaYx178y1CCYYJPd5
	 M0YWj1xtNLj3G0MKgib2efW2l8+WmRQoNYVX0S5HJ+3Q18vjgcs3kUq+Vn/AF0H4cW
	 R44zSibIEh700wLrvhVjIeW0dqV7UE7CFjhxdNEGMW4tz/tncUdJk5iXY5b109XGjo
	 uWiNmKW394VNvbX5MXjljrSyWslUukTmmZfJe0JDQ7py9TsuOF5p6kh2BOffIELXQM
	 RI449OeIPj4JA==
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id 10D83180055
	for <internals@lists.php.net>; Mon, 29 Jul 2024 10:22:25 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net
X-Spam-Level: 
X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_50,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,
	FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,
	RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS
	autolearn=no autolearn_force=no version=4.0.0
X-Spam-Virus: No
X-Envelope-From: <cmbecker69@gmx.de>
Received: from mout.gmx.net (mout.gmx.net [212.227.17.20])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by php-smtp4.php.net (Postfix) with ESMTPS
	for <internals@lists.php.net>; Mon, 29 Jul 2024 10:22:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de;
	s=s31663417; t=1722248445; x=1722853245; i=cmbecker69@gmx.de;
	bh=21QBcvIdg9j2eRvwlMw+W5R/xLY9+RMpNgnYFqQzjhI=;
	h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:
	 References:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding:cc:content-transfer-encoding:
	 content-type:date:from:message-id:mime-version:reply-to:subject:
	 to;
	b=F1Lc4IyEaxlUzjbIMn6Fe/vQn3PmFh+dgKFWS0n85zyKOsRVNYH4yuo2XawamsDO
	 ySvzRJbnwVckoolaW7GXIuDpxX1MRKqNxZ6nS5k0pv/a0Q8y2UcXjkwJbrNh+x9bi
	 vJ5DR8jqmuPJl2vjAHcO7oKYi2rVW+On4CdTrIfStRlXIIf9lmDnydrYQAkmfPPMK
	 bWvQ25S7AYnhAKmkikLV3aPQH44r8V+XhrNV8YYDBqSxUFRXvkR7v6WXr8Igz4wvj
	 HMeL8R9nFhY4byPlPmwtIxjQDph/HmG/ZLbJAKlglACn8J7DyTnKB8IjpgvJlVVFy
	 K4SmC+91Yw4JL/sK2w==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.2.130] ([79.251.205.37]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mn2aN-1roYby1kCF-00f2T3; Mon, 29
 Jul 2024 12:20:45 +0200
Message-ID: <ba09ea49-ddb5-40b2-95d8-478528e85cae@gmx.de>
Date: Mon, 29 Jul 2024 12:20:45 +0200
Precedence: bulk
list-help: <mailto:internals+help@lists.php.net
list-unsubscribe: <mailto:internals+unsubscribe@lists.php.net>
list-post: <mailto:internals@lists.php.net>
List-Id: internals.lists.php.net
x-ms-reactions: disallow
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PHP-DEV] Deprecate ext/curl `CURLOPT_DNS_USE_GLOBAL_CACHE`?
Content-Language: de-DE
To: Ayesh Karunaratne <ayesh@php.watch>,
 PHP internals <internals@lists.php.net>
References: <CANLbj-rn9kfQGzx=g0LP5AkRLeEWx3XDYNQ8FKf=uMDrRWLGAw@mail.gmail.com>
In-Reply-To: <CANLbj-rn9kfQGzx=g0LP5AkRLeEWx3XDYNQ8FKf=uMDrRWLGAw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:++Ehu0n/0wwvr1W74hHdCHd/iFu0de70gw8ELn2sWGEUqv1cLBf
 x7OnATAziUa318aUGPM5OD4sNtAJjLxqpv3ZWny8mgY2a5/UZAFDKWWyXtmBCWfFdFX10Mp
 1csC4zt0UpWkk7vgejJ+qzj9/3rSxSXWaCuVU4YlwCHNOkHty8rkuFQ6J5Qm+7SMGVD9/op
 8CYmYsjmQKLAdAHOID0FA==
UI-OutboundReport: notjunk:1;M01:P0:gX8eShrREtA=;qUK4ZYiNtMyFd2ylzYAL4gEdzP6
 v1RCenDJsybU/mT55yp6TThsl1FEVridCLLr4zvRlHHvbu+Rn/JS5dQzHpMaYFe0ABt/nSOVr
 uegBQJ/N/H/B1oUccqGS4jXxb2fvD5CUTwJ5T+3HPqk0LyRPWSDaL/xzTVKMSru/3NjUJAQUI
 1cMxjhvyFECyDPM3hJ7aXtsyrfU2TzcuV8plTiHfI1uo8f4NAckAZvc34ZcHXaE16CQtwzTi5
 hb61GILwz5y7rSVclhVIJAnI3KJYtnGO14/229hNgNwfbpht+uMuvhwY8bHLSjdbf+Waq6LjA
 BGwsrWSwZvfv4vU9DQCVIjLTh7KXp96YH4BmIEMfTHIQpMNylRVvSqQ38KWLdCjcTxjbyW28V
 UmKx5fBalPXInc3Bzun7/SAc3g7m1sFQe7HZlM8hqGg+3w48dfnBnWUEGR8u/I/uIPzUOz2Z1
 q/NskPBfZWmGpbaZdPvAwG5u3aorxk02H+0l1TqOeuUTHxL3kfu5RHFr0njCPcPtTvp4NhygO
 SIismtQ0Oy/69O5nmets8Njkf24R9uLtWekEDq/HSFKZI9y3Cii1ZaaHNp8YmR+lwJs8v4fsT
 hHPturGxsAWY1zjDYyCkKEIeKSYy0bLU2RtvK+Mc9NVyDU0GXsmF79VDpZ6+3nX78fYWDZvqD
 I92iAg1/tp9vVX5BEHRXlN4uOSgm62uPd9iEG8HtR5mynaAfMTBfh0tQoz0kk3iHwcZ6kjNX6
 ddR4CXkJpAbPXm3Sxd/4Kk8vDjHFJifgedsqdjHUgavjKhquKBJquiHLPxvUGfJr4WDyVLstj
 MkQNFCUrLK+LJhLBkF3MbURg==
From: cmbecker69@gmx.de ("Christoph M. Becker")

On 28.07.2024 at 19:26, Ayesh Karunaratne wrote:

> We recently bumped[^1] the minimum required libcurl version supported
> by the PHP Curl extension to 7.61.0. This aligned with the recent
> CentOS/RHEL 7, along with other major Linux distros that have already
> updated to a more recent version of libcurl. I'm writing to the
> Internals to get some feedback on deprecating a Curl option (a
> `CURLOPT` constant) that we support in PHP, but is removed on Curl
> 7.62 and later.
>
> Curl supported an option called `CURLOPT_DNS_USE_GLOBAL_CACHE`[^2]
> that enabled Curl to use a global cache for DNS queries. It was added
> in Curl 7.9.3 (2002 Jan), marked as obsolete soon after, deprecated in
> 7.11.1, and removed in Curl 7.62.0[^3] (2018 Oct). The reason is that
> this functionality was not thread-safe, and was not functional after a
> few releases. Users can still share DNS caches by reusing Curl handles
> or by copying the Curl handles.
>
> The PHP Curl extension does support this constant, and if PHP is built
> with thread-safety enabled, setting this option emits a warning with
> the text "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread
> safety is enabled".
>
> I would like to propose to either deprecate this constant, or no-op it.
>
> [^1]: https://github.com/php/php-src/pull/13259
> [^2]: https://curl.se/libcurl/c/CURLOPT_DNS_USE_GLOBAL_CACHE.html
> [^3]: https://curl.se/mail/lib-2018-09/0010.html

I'm somewhat torn about this.  Generally, as a user I prefer to be
notified about a feature which will not work; a deprecation notice would
do.  On the other hand, this is "only" a caching functionality, so it's
probably not much of an issue if it doesn't work.

Actually deprecating the constant might require the RFC process, so
maybe it's best to make it a no-op for now (and to deprecate for PHP
8.5/9.0 whatever is next).

But regardless of deprecation or no-op'ing, we should document the
behavior, and tell users about alternatives to accomplish the same goal.

Cheers,
Christoph