Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118801 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31869 invoked from network); 12 Oct 2022 01:23:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Oct 2022 01:23:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 63FD4180054 for ; Tue, 11 Oct 2022 18:23:19 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 11 Oct 2022 18:23:18 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8B66D5C0071 for ; Tue, 11 Oct 2022 21:23:16 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Tue, 11 Oct 2022 21:23:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1665537796; x= 1665624196; bh=E5Vd2YMnJcYf7S1iEJYwASRlPnu5r54wR5KnU2SOwKo=; b=i D2WKYZGOluzh8EiC5TCdj5HRtqM1tTjipk9qj8+rTjRgRA/BoFCzct+S27R3SSkZ drAY8CFz/QJFU02EoD4PACWv+Gu3RMDm/p3ASEzNS3+Nn30SF/IQLBnXPoJ69mJG GweuWEJehVF++n8I31/MfgLa4NwpXOiFcSz74nHHklZej4Od+iFcoKVo2atzTsXT gIF7txweTvQnSA0KeYsElvpFiQ2B6iQU9FiZ9WT50Il6XgW6g6m4pWQURjFUVxrw 1AYoFs+eWdnjH+DzKZ1W3co5EVc/XAqSBeCdewJxaSCvA7W6mttCUTZsusg1NN4o MNtytc4zrz6VfifJvk4tA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1665537796; x=1665624196; bh=E5Vd2YMnJcYf7S1iEJYwASRlPnu5 r54wR5KnU2SOwKo=; b=l1EEALcNPqykdLP+grGnIBLYf49xEPlENMluGKPyCBt2 UYN5aKI0TOlnuWGFaa6X1yI1zRa3PN3bamK8o8EANEGEML38T2X/pOoOXt+YULsC x+Ara0+FKEuXw1zw9vR5/o0zgvyeIwsxNIPJUCv47mUgwZRpNfS495Quk/O+8IKk RDksPBgEhNsjr0G74a8Z4xX8jcrPmDKOsmg1zKsCbmy3VCCeTsFdSeW4rPX1XeZD sSOaIgpOQSGeLdFhA9SzIIJBp2bKAivf/zh52WlDHMH22nuTmOh9IHqN80c2eRMC uyNiBY0DqfsSQ2c8rbnKEjFcasLee2wQPMPxv4Lwdg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejjedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeevgeefteehhfelieeihfdvvdfhheffffehveeffeeg keeludelieejudehffekffenucffohhmrghinhepmhgrrhgtrdhinhhfohenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghr fhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4D1591700083; Tue, 11 Oct 2022 21:23:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1047-g9e4af4ada4-fm-20221005.001-g9e4af4ad Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Tue, 11 Oct 2022 20:22:36 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Feature preview (formely was: experimental features) From: larry@garfieldtech.com ("Larry Garfield") On Tue, Oct 11, 2022, at 3:25 PM, David Rodrigues wrote: > In order to try to organize a little better the original purpose of the > discussion I started, I decided to "rename" this subject to something > closer to the purpose. From "experimental features" to "feature preview". > > Original thread: https://marc.info/?l=php-internals&m=166491585711553 > > These are my suggestions, as per the discussion that took place during the > original thread. > > (A) What are preview features: > > (A1) There are features ALREADY 100% APPROVED through the voting system > among the PHP team and that can already be implemented in the language in a > preview format (via PR), available to the general public through > minor/patch releases through "preview" markers. > > (A2) These are features that are understood to be effective for the > language and that will be available in a future major (eg. 9.0) or minor > release (eg. 8.2). That is, it is not intended to be removed "at any time". > > (B) What are NOT preview features: > > (B1) Suggested features, even if well accepted during discussions, but not > passed the voting process as approved, even if a PR is already available. > > (B2) Experimental features (literal), whose idea would be to test "in > practice" its functionality before deciding if it will be part of the > language or not. > > (B3) Features that may have a high risk of rejection due to performance, > security or usability issues, even if they were approved during > voting. That is: when in doubt, even if approved, keep it as exclusive to > the next release. > > (B4) New features approved but with pending discussion should not be > previewable. For example: json_validate() is approved, but the function > name is under discussion whether is_json_valid() or json_validate() is > better. In this case, it prefers to keep it out of the preview until that > is decided. > > (C) What changes in the voting process: > > (C1) An additional voting topic to decide whether a new feature can be > previewed or not (i.e. basically deciding whether the feature is safe to > test ahead of time, taking security primarily into account). > > (C2) Additionally, decide what the target version of PHP will be (eg. PHP > 8.2? 8.3? 9.0?). This helps more complex features get more preview and > feedback time. > > (D) Advantages: > > (D1) New features will be able to be tested before an official release (eg. > 8.2), and all issues can be resolved before this release. > > (D2) During the voting process, a feature can be developed for the next > version (eg. 8.2) or postponed to the next-next version (eg. 8.3), if it > encounters difficulties, without freezing/delaying the release of version > 8.2, for example. > > (D3) Regular users will be able to test features in preview, without > installing nothing (eg. PECL), since they will be available natively in > PHP. Of course, with the notion of the impacts such features can have (like > needing to use markers, minimal performance issues). It is important that > the documentation makes it clear that a particular feature is under > development in preview mode. > > (D4) The development team will have early feedback on these features, and > will be able to work on fixes with more "peace of mind" and security, since > there will be no obligation to release a patch that quickly (except for > security issues). > > (E) Disadvantages: > > (E1) The development team will have to pay attention to early feedback for > a feature still in preview. However, this is something that would happen > after the final version anyway. In practice, I imagine the time used would > be equivalent. > > (E2) Once the final version is released, the language would have to accept > some markers temporarily and deprecate-notice them until it is sure that > users have migrated to the final version. Probably these markers should be > permanently removed at the next major or major+1. > > (E3) Users using preview features should be responsible for updating the > code as soon as the final version becomes available. > > (F) Final considerations: > > (F1) Preview features need markers, either in the function (eg. > preview_json_validate() or maybe Preview\json_validate()), in new classes > (eg. Preview\XYZ::method()), in new methods (eg. XYZ::preview_method()) or, > if affect the language itself, in declarations (eg. declare(preview_xyz = > 1)). > > (F2) Preview features can only be removed when there is a serious security > risk to the language that is irreparable. By way of comparison, removing a > preview feature is like, after releasing PHP 8.2, dropping support for > "readonly" as class modifier. That is, it is understood that it must be > thought of as something unfeasible and impossible to happen. > > (F3) Preview features can be started in PHP 8.1, for example, and made > final in PHP 8.2, 8.3, 8.4 or 9.0, and so on, as long as this is decided > during the vote. > > (F4) We can try a single preview feature. Instead of thinking that > "features in preview" should become a default for PHP now, in a definitive > way, we can opt for a new feature approved in PHP 8.3 (currently I don't > think there is any approved, but eventually we will), for example, and make > it available in PHP 8.2 as preview. So we test in practice whether the idea > itself will work or not (and even user adherence, with open source projects > and feedback). And if all goes well, we can make it default for PHP to > offer this kind of support. If something goes wrong, we can let this idea > go. > > (F5) Preview features should generally be released in patch versions (eg. > PHP 8.1.12 to preview a PHP 8.2 feature). > > > > Atenciosamente, > David Rodrigues So let me use a concrete example as I'm still not completely clear here. Let's suppose, hypothetically, that the asymmetric visibility RFC passes on 1 December this year as a preview feature, with the current syntax proposed. It's a syntax change, so polyfills are not possible and namespaces are irrelevant. You're saying that "public private(set)" would become available in 8.2.1 (the late-December release of 8.2), but only in files that have "declare(asymmetric_visibility=1);" at the top. However, we could still change the syntax from "public private(set)" to "public private:set" in 8.2.6 if we decided to; that wouldn't be considered a BC break. But once we get to 8.3.0, whatever the syntax is at that point is frozen and no longer changeable, and available in all files. The declare() is now irrelevant. Is that how you envision it working? --Larry Garfield