Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120649 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8427 invoked from network); 20 Jun 2023 22:53:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jun 2023 22:53:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 39C3A180089 for ; Tue, 20 Jun 2023 15:53:42 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 20 Jun 2023 15:53:41 -0700 (PDT) Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-560a2e87bc7so529353eaf.0 for ; Tue, 20 Jun 2023 15:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687301621; x=1689893621; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QixnqM6+lfm4EFQL0mWPh3L/ay28D54BszS4K+2PkLg=; b=h9TpqE6rsOO9a9vu7phX8/8wZxja9LGuyzoC02LZJDFUayZM4kXM6RQHgMji7kbwho 6LN5xYiVGEe/bng+p8JxdJ3GInC3U6cnCdU+u+wLKi0Lp8fLFvQoYJVqSKiHhRAUcY3w X66oeaQsCfDsEi4sOgYe0ZPDpuh+fSvpj4zJUsFnSg4Yy8cmeJdB1K13Wh1H00+Boevu uLh0zBLWx3xHrwKhEpBn7sUbvZvQbwybG+IfG70tcCporAMn7e4FRmLun6QHlxCn/xqe oVP8Z0qNd7plzWFzQSLHh76wer/cQKQHRigOLhHM8qTdLF2RAXySsi9Pj3QBX2wAfVaw KXGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687301621; x=1689893621; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QixnqM6+lfm4EFQL0mWPh3L/ay28D54BszS4K+2PkLg=; b=gBMTiFaZpwBAi9ioxfrcu+drMCKPlk/Uia5eklGng8Z6p06+dFyFhyQDy0EQonk/FO dZ2tGUSwtMIBg1JXtzO/HbqCRp0UsQC1nUP70NDBdLndpIclzy1k4lccbecrV44js/yQ NY477Th/DEO2kh+nttPY0ziVjm8/72eRMhv4STVlP0H1IlShIKNzxrdzkNb5iLQTpzb3 FAAejvFIx8eKGLPAGZXjxNe6MNuVTHQPzxT74zwUoA3cRYmv9TVCYzaxsf0UojdEitA3 EaTgT1u4WwMI1ZoZAtyf8Jo9ooCMT0CT8BtH7mz3aAPqfZV4egreWfGwu4bUmMfKgF6E NmGA== X-Gm-Message-State: AC+VfDylV0MBxuhti04fWAd51K58i/4mtixRK/hJU8wqNyPyHQHTTMay BwhPTRMMK81zsUgXrkHxnTyUjL2DTO0n4fdhDf0F7kG1 X-Google-Smtp-Source: ACHHUZ5ltBaMQRLKXA0HaKMBU07wHEkh8ci1qZHpCL8GiVY3n5n49mR3p7WkHV7IDj3j6c6MZq0hGJQLHjI3jx5NwpQ= X-Received: by 2002:a4a:c819:0:b0:558:b26b:6442 with SMTP id s25-20020a4ac819000000b00558b26b6442mr6363412ooq.6.1687301620823; Tue, 20 Jun 2023 15:53:40 -0700 (PDT) MIME-Version: 1.0 References: <108411AD-DBC4-4436-8190-7569B7A0805F@gmail.com> In-Reply-To: Date: Wed, 21 Jun 2023 00:53:29 +0200 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000bcfc5b05fe9785a2" Subject: Re: Fwd: [PHP-DEV] [RFC] [Discussion] Deprecate functions with overloaded signatures From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000bcfc5b05fe9785a2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable HI Nicolas and Rowan, Mate, WDYT of 2)? Your sentence about better typing rang a bell with me: I think that's the best argument for removing the signature accepting callables. But before coming to a conclusion, let me answer Rowan's question first: This is where I don't understand what you or Mat=C3=A9 consider to be the > alternative. If we create any function with a new name, then we have two > names for the user to choose between, regardless of whether that's one ol= d > name and one new, or two new names. That's why I'm saying that if we have > two names at all, they should both be chosen with new users in mind, not > fudged based on a combination of current and new naming styles. > > Once the deprecation period is over, we should be left with a pair of nam= es > that obviously signals the difference; or, we should be left with only on= e > function. > Of course, the best situation would be to have only the new function name with a single signature. Personally, I also prefer the OO style, but this doesn't really matter now. However, the sad truth is that we have a very widespread function with a slightly incorrect name supporting 2 signatures for more than a decade... On top of that, while most of the other deprecations in the RFC either affect rare functionality, or are suppressable via a simple polyfill or some automation/search+replace, only supporting the OO style signature of session_set_save_handler() would mean that people would have to wrap the callbacks in a class. This is not automatable, and requires some possibly non-trivial manual work. This means that we have to change anything really carefully here. With all these in mind, I'd say that the strategic goal should be to have a single signature + the new function name only. Reaching this state would affect every single proprietary codebase in some way or another, so I don't think it's feasible or fair with users to try it in one single step. So in order to reduce the damage, my plan is the following: * Let's keep one of the two signatures which are compatible with older PHP versions so that at least a fraction of all users (maybe 50-70%?) are not impacted at all. That's why session_set_save_handler() should not be removed just yet. Since the OO version seems more future-proof based on Nicolas' great argument (it accepts an interface, while callbacks don't have a formal signature), we should keep this form. * People who use the signature to be deprecated should not be forced to do non-trivial changes. So introducing a new function for them will keep their code run with a minimal effort (search + replace), while we managed to eliminate the overloaded signature. At the same time, we try to educate them (mostly in the manual) that the best way forward is to migrate their code to use session_set_handler(). There's no deprecation just yet, and everyone can do it voluntarily at their own pace. * In order to finally achieve the strategic goal, we deprecate the old function along with session_set_handler_callbacks() as soon as the right time comes. That may be PHP 9.x or 10.y or 11.z, whatever. This process may sound complicated, but in my opinion, this is the least disruptive upgrade path for achieving the goal I outlined above. Sometimes going full ninja mode is possible, but I'd prefer being careful in this very case, especially because I guess some people do not consider the motivation of the RFC particularly important, so I would like if their cost-benefit analysis would stay positive (I don't only mean voters but end users as well, since their perception also matters when they are fixing the incompatibilities of their code). M=C3=A1t=C3=A9 --000000000000bcfc5b05fe9785a2--