Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114965 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42663 invoked from network); 18 Jun 2021 18:15:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jun 2021 18:15:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7D1EF1804CC for ; Fri, 18 Jun 2021 11:33:14 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 ; Fri, 18 Jun 2021 11:33:14 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id e22so8169780wrc.1 for ; Fri, 18 Jun 2021 11:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=JH/2ZnsB6oV0xvGDWd+yK3VkAlyppVjCFh289guvRI0=; b=KLjXHofNROini2Fwu07wT8uWMyYiDURerlO9sLoQybGsFdzb10fqDthl/Yw9li8n2B /FytQ+JPUYPAiR2igeucL/3oHDbtsegREJKtHYxNss12fP8z4ngTw1u4vURHSKaB7rgy fy7zNcj9Gc1WqHKWnmU8iASCuN6GCzt1XtuAKo8QHUl6HN7t0WBVDrfkdnbUNqPhDo/p LGUMx9fBPDRCMK8zyRHWiu7HAw7bf3JDoegZVXBLJmDTuqR7sPjllG/nvywaXQNRVjMJ 99xATofc4bwSWZgi9vGFF1NQmi9phfJEoZXU9elGpc91JgRC5tB6s2Xeun9ulcChAt3V ZVDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JH/2ZnsB6oV0xvGDWd+yK3VkAlyppVjCFh289guvRI0=; b=qkxpu7A7wnomspdjQgXvx+C8zasE4yzw2137UxcnVJu+2wzi+biRAF0QsARNxnqVQl ETP0c8VMAEi3MdSdXRJajzxLmh59cZ8bx0hJzQ0d5sFtia/vYcuqFpqGY+POZvB98zMl C7Hr1NZzOQB5BAElUqtKtuBWU0EjohWhGHZmGbMHkdGwPj3Aafto7sjMUixhzC4ZLjOE nle0GsgRxQXB7Y85VxArWjeGL3hnD5YxUCNegi5TR6u39/CTDpwVmBDp1NHOgQxcfTI2 532rN+Q0ZDM2C7OZsJi5Z26qF73WYpj3kRcGGNrPaRjBFA3U8vka68x5KMqZjPZhG/Wl j4RQ== X-Gm-Message-State: AOAM533Bz8szIFFuMBkjV6GHdT13CEzcjHpwS2OlvVa9kfYt8J48qtmH k7XsD5LZ8UJuqunxm88whsx9qFoJh6o= X-Google-Smtp-Source: ABdhPJysLntiTZTJg1OOqV1132YNPnh58nx6YuFcbeQF/6C1/8vOkXOPZfxWw+QTgSK5tCqqziFYZA== X-Received: by 2002:a5d:4538:: with SMTP id j24mr14062208wra.391.1624041192111; Fri, 18 Jun 2021 11:33:12 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id f19sm8972714wre.48.2021.06.18.11.33.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Jun 2021 11:33:11 -0700 (PDT) To: internals@lists.php.net References: Message-ID: Date: Fri, 18 Jun 2021 19:33:09 +0100 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; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] Re: [RFC] Deprecations for PHP 8.1 From: rowan.collins@gmail.com (Rowan Tommins) On 15/06/2021 11:53, Nikita Popov wrote: > Feedback on the proposed deprecations is appreciated. Personally, the two > I'm unsure about are "get_class(), get_parent_class() and > get_called_class() without argument" which are mostly stylistic in nature, > and "strftime() and gmtstrftime()", where the non-portability issues are > possibly not so bad that a disruption of existing users is worthwhile. To add some more "anecdata" to this, I just ran this to check for most of the mentioned functions against the code base I work on (~800k lines of PHP, the oldest dating from 2002): ack --php 'date_sunrise|date_sunset|mb_check_encoding\(\)|get_class\(\)|get_parent_class\(\)|get_called_class\(\)|FILE_BINARY|FILE_TEXT|strptime|strftime|gmtstrftime|mhash|mysqli::init|filter.default|auto_detect_line_endings|ssl_method|FILTER_SANITIZE_STRING|FILTER_SANITIZE_STRIPPED|oci8.old_oci_close_semantics|odbc_result_all' -oh | sort | uniq -c The result is this: 1 FILTER_SANITIZE_STRING (which definitely looks dubious) 1 auto_detect_line_endings (which is commented out anyway) 276 strftime (nearly half are using the format string "%B" to get a translated month name, the others are using various "human-friendly" localized strings) Running the same command on the vendor directory, I find a further use of strftime (in nusoap, which should probably just be using date()) and a handful of uses of get_class() and get_called_class() (which I haven't looked at it in detail). If it went to a vote now, I would vote "no" on strftime: * Looking at the proposed replacement, IntlDateFormatter, the API seems to be much more complex and completely incompatible, so migration would be painful. * The codebase never needs to run on Windows, so portability is completely irrelevant to me. * There is a note on the manual page for setlocale() warning that it is not thread-safe, which if true would be a stronger reason to deprecate strftime() and friends, IF there was a simple thread-safe replacement. However, that's not mentioned in the RFC, and I'm not clear if it's actually still the case. Regards, -- Rowan Tommins [IMSoP]