Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115175 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90635 invoked from network); 28 Jun 2021 14:36:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jun 2021 14:36:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D2E051804C3 for ; Mon, 28 Jun 2021 07:56:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 28 Jun 2021 07:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624892174; bh=+klCAz9PXzSLr2LawJJVF7IU1OtN+y4wFpUaX2WUuRU=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=KSw1jCkAv5A4nn8Q7Fw7xjDWWdiT0jAKcMUH7MR9a3cJdk1CCT8h0yPzgCr15H4+N xnaFYGCKFz1URu+tW1Fpc3zG4Eo4vPiFuPqguXDF1Oa4TYD+XMeaoMn+LXpIeUEXzd CyCsjj4H5TGMtSUQu0Rn3T72IMFxvOLKO7ASpji4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([79.222.32.221]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MmULx-1lX2Fw3vv7-00iXrc; Mon, 28 Jun 2021 16:56:14 +0200 To: Nikita Popov , Rowan Tommins Cc: PHP internals References: <4D4B548F-5F51-480B-AECF-FC2DB586F396@php.net> Message-ID: Date: Mon, 28 Jun 2021 16:56:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Fmu2nbzWkM4pkWqWJ2BKVbreGZImaF8hZc1mY8AWPa50oC80+SU 7ekYJNS+x+DtM2GN1DNMW1FNEKSROmSvmJOwlcERUhYWbacXdMAaFWNtbDqeYVOxafHjCjF ONz8oeelfI3OUrqk5iiePOuaA2Y+GbfwKBCsyp+xXxQ+PFK6EJJrWUkZyRQnJvE/h1z+WPW GlTXKLrdwXSJdftQr69MA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ng+r5Q2fJXY=:q9NZ276FGK1+EFkQNeWSBm R9V3OazERzQLcFOGTdAPx+m9JwsSaIUTS2VfnKlD8stOqE1LaOcNokZC2ZpAwCgyEjDX+gQJA yeiFZP1qjN86mE8HLXy5xrtwbxo0kmYzzBykMfuQQT7N+r1jhSgPO1ZfS/6p8LjIh0lamyZmx FV3CVW1SrT3g7phBLguDkDCiQtjZ1+lffmH2u4JmO372ScR6CWEen1zCC5q3QsQDYr1HD9xOg 6meTTC4D/FMFEdG3lvZitJ8Q4xxO75//lPuaDYmpRlnTTtVYXws1x4uCxwXkY5wTHGXrWeoed 0Ju5eF9oMRp77ESZSaKOdhFHZWskI0j+08dT14Ujuny17yhTetwtdgDybCUJ+eLTafmDzAGVM ImbT8lrQPkTKLkKbzU+GZBrJnI+fNxFNexf840hQoWXfPId+jGJyIupaDTGiVeyzfIdybcVS/ C+0SgwaBVqJDVHSWQ5eLhZ2gMDuikRjObpO8QnA7KTzkFIQfZ7aKgfW27PNyp6ItNHpIETpKO 6pnWtiY4R8CS2K+yIO4CzpWcFxq/1JIBCSMUFmyp5hcZthchA6nQOW4V+P71wAu4OOM2du6Fi ynVIBgHj1rb2bi2PLzJPmPUCyaAhJB5Wx7Oqnqk4jCe9+0at+V3kiUvbooor9IUYww1DX35Wu uAxkSlt2UX86Anw59ghs7fS/t8rrDkBn1oWbCLPojPghS2uyqPtVdHTzLYjenJlwfxLkSjHuC ofCtH9PVus/D5pvXeX6ceaxDuaW9TOpmzwaiVuUhC43+NXNlRkjzFRHrMzZO7j/DKmCopGnEQ aq4carUc/bBEKBRCZGVMiM1Po7Q08RCeDwPuYqQmQH+rTAX7VJzxzph5mbDHYlFZU38e7A9+/ S/N3TK9hg8k7oZL/ACR2tg8kI3Xi5Nr85YXd8M98JX3SMMP0ZBfcTavU5rTdT/11ApswGCsFq yj5AFRq+2ORToaPs9CfoLS6tbLZEwfE/KbUhtRLQM09U8nFnQucdfFR+dasiodQXeKH1nXkg3 ZJedHtlWJTMwukkIm9cLbc3fLKC3/JIPM/H4HfckcO5hc3+LK3OIx4VNbJDAJImvazIHeZOFS EYG+1BTd2qqRMGZPBq1ijCKVm39Z9wMpuqm Subject: Re: [PHP-DEV] Re: [RFC] Deprecations for PHP 8.1 From: cmbecker69@gmx.de ("Christoph M. Becker") On 28.06.2021 at 16:25, Nikita Popov wrote: > On Sat, Jun 19, 2021 at 1:04 AM Rowan Tommins > wrote: > >> On 18/06/2021 22:16, Derick Rethans wrote: >>> strftime is infected by thread unsafe locales, which is plenty of reas= on >> to deprecate it, with additional pro reasons for doing so being its >> disparate functionality among different os-es and libc's. >>> >>> Deprecation also doesn't mean removal, which won't happen until PHP 9, >> giving developers plenty of time to move to a saner threadsafe locale A= PI >> based on intl/icu. >> >> >> I think you're probably right, but I think in general deprecations >> should be accompanied by much stronger migration instructions than >> "there's a class over here that probably does what you want if you kick >> it a bit". >> >> Like everything in ext/intl, IntlDateFormatter is rather complex, and >> the manual relies heavily on links to the ICU documentation, some of >> which are 404s. If you're saying my 276 uses of strftime() are "wrong", >> it would be nice to have a clear message of what is "right", and what I >> should do to "fix" them. >> > > Yeah, I definitely see the concern here. In my corpus, most uses of > strftime() are actually locale-independent and can be easily replaced by > DateTime::format(). I guess these are only being used because calling > strftime() is slightly more compact than calling DateTime::format(), whi= ch > requires creating a DateTime object first. A small handful use a locale > sensitive format, which would require IntlDateFormatter and its more > complex API. You could just call date(). :) > I believe the equivalent for %B would be something like this: > https://3v4l.org/1pNDi I think that would be %b. For %B you have to use "MMMM". > It doesn't help that the IntlDateFormatter API is > un-great and doesn't allow you to directly create a formatter for a patt= ern > without passing a number of irrelevant arguments. ACK. > Regards, > Nikita > > PS: I found this scary comment in the strftime() docs: > https://www.php.net/manual/en/function.strftime.php#104043 48 upvotes. d'oh Christoph