Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118740 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80144 invoked from network); 4 Oct 2022 20:42:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Oct 2022 20:42:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 164FB1804BA for ; Tue, 4 Oct 2022 13:42:45 -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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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, 4 Oct 2022 13:42:41 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id y5so3161818lfl.4 for ; Tue, 04 Oct 2022 13:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=lvb7+GXPmNrk992y/C7WOBLijH8H2t+V164dwO5VuEk=; b=JGI1U3XiwTvVpnuaHef5Y2C62Zb7z1j6s2TFgE0fd5KzJxAqh3KXlIc1XtU7CgTjMj 4f/G3LzEfprUFC6iD55UW4vcgANfiIqxAR5aRt9mX+I+qfHAC3U8ijNZ+598bM8MmRwC nXEjKve5KLn164Vq3yW8PUrXKhcizPJJvnPTknA9qtuIlppLqBjVXuEjPl8+f1OyLXoa VRc2W6iNcwHtg9bqKCmRW2mwCW99g4QOajsF0eLRz//drPEDrj4ztEPrA02TcEciARp0 RHyreti3BTIuGRnv5ulVTUANBrlu4TcabtH711XQg0qSRCB/5woQCYRYOHa4Xqi6UFRN 31pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=lvb7+GXPmNrk992y/C7WOBLijH8H2t+V164dwO5VuEk=; b=L6oSVCp08O4BzdDEubRw8o3k4bsfwBVmqITCDw8ul2Gjgpa1nQa1wjGFXyHjxamIcH gK7G2EesKF1ASS3nuukeSbkVNHjVRUw+SRkI6xEFZow5LRZ+B4QADzCeT5EotTrMnVPp cNm3gAyghOe5Xpz2kk4vE4eAukOpkCz4sDtOmndmaz4hCylnbOhi4c/Ecr8mbnyavQHe m01c0XWfskKahXE9dZdr3Ub05LHXnH4M0MgHueTRu30ZL/jrx3pNDJ4mqSwdCuOxRifm CqxQOEQPEdROr2DyTCUDJGiMEapNlVq94QxOVSrTfZA6chLFnFDo3lxyzKLD7Rmtg/9d 5ElA== X-Gm-Message-State: ACrzQf1M3fifMp6Ql5NJ3yaJ5XdEfrKErikAioJ8mKUY9zakCB2xneLj 4ehfjUBwEWGD7A3Ve21gG9fVpmf3cgW4dkdxfAbfNz6BT7c= X-Google-Smtp-Source: AMsMyM7a/xOxZjfHtx27wrRhqlFuLIqpNwgb0uqFdrfkToGKlUV8cJLJcFk/6wsQCTX3kN1rREZtcP4PFg6OVEs7350= X-Received: by 2002:ac2:4c4d:0:b0:4a2:4a6a:b24e with SMTP id o13-20020ac24c4d000000b004a24a6ab24emr2836113lfk.146.1664916159706; Tue, 04 Oct 2022 13:42:39 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 4 Oct 2022 17:42:28 -0300 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="00000000000047bc3905ea3b80db" Subject: Experimental features From: david.proweb@gmail.com (David Rodrigues) --00000000000047bc3905ea3b80db Content-Type: text/plain; charset="UTF-8" I wanted to suggest the possibility of introducing experimental features to PHP. This is an old thread I guess, but I think it's good to reevaluate the situation from time to time, as other languages already do this to some extent and PHP doesn't. Some platforms/languages (Node, Kotlin) and libraries (React) bring features natively in an experimental way. I wanted to propose that we bring this idea into PHP, so we wouldn't have to wait for new major/minor versions (eg. 9.0 or 8.2, 8.3) to try out these new features, and so when these versions arrive, they'll already be quite polished, avoiding patches sometime later due to wider usage of users. My idea is to have two levels of experimental features: (1) Via declare(), when the feature affects how PHP can act when reading the file itself. Eg. declare(experimental_operator_override = true), Something that happens with Kotlin, for example, when we use some experimental annotations like contracts. These declarations work "per file", so whenever it is necessary to use it, it must be declared. (2) Via experimental identifier name. Eg. experimental_json_validate() or Experimental::json_validate(), like in Kotlin and also in React. Experimental features can only be brought into a minor version (eg. PHP 8.1.12) when it is minimally refined and practically ready to use. It would be "kind of" an expected final version, no new patches are expected (we hope), unless something really went unnoticed. Despite this, experimental features may not exist until the next major/minor release if its practical inefficiency is found or if the concept is shown to be invalid. So it should always be a "use with care". However, if an experimental feature is successful, it becomes final at the next major/minor or major/minor+1. The experimental version becomes an alias during some future versions until it is removed entirely. This is the time for users to adapt their code and for IDEs to help us find them. With this, we can understand whether users are making use of a certain feature or not, make improvements on it, etc. I notice that many good features are rejected because they are believed to be bad for PHP or can be confusing, but without any practical testing. Experimental features can make this analysis more grounded in practical data than just possibilities. However, this also doesn't mean that any idea can become an experimental feature, but ideas that have a good foundation and a good discussion before it. The difference is that the feature can be tested in practice before being totally rejected, and approved features can be delivered ahead of time to refine before the next version is released, allowing users to try them out more easily. Atenciosamente, David Rodrigues --00000000000047bc3905ea3b80db--