Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118741 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85927 invoked from network); 4 Oct 2022 22:38:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Oct 2022 22:38:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2750B1804AA for ; Tue, 4 Oct 2022 15:38:01 -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,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-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (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 15:37:57 -0700 (PDT) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-3560e81aa1dso126172927b3.2 for ; Tue, 04 Oct 2022 15:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=GXnD6gmdhY2XpBV5mkasJ63mS0wF93wsbewc/NM/e/I=; b=DOSbH2OVzbMky+psjDG5vROuk2Rkyv/fz2xqxfBTEXFMr6Jkv/hBOJzi8z5anqG/Sb psggt2Zq97xfMaoL1tNgYCTR40c8b7bAI5shsLHRSiVPrgQonXLM0GiOy+ZGtM4crpjY 3kT84PI7rC/jp5sNI2tomPkcJcrj6asPrX6vk7dQOgzywMdTSsAsYZ7jYah1If7lz1Tw U+ZYqaR0yjcXEyFham/nudtrAFsX/zq8PV7+29HXmkyZ8uIgwcdRho6MbfHNh4CmdszC ZCgOlKQs5eKZkUQDc/rnyWoRGQQ9gwwwcxZy2RrvXkdC5WH7w3ipoB0VO6vwcCvuoFFN Aixg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=GXnD6gmdhY2XpBV5mkasJ63mS0wF93wsbewc/NM/e/I=; b=hjaGTMePf1RBUSaCvhTLD08pfKsmIjhqOY66b4zxS6R032Sq6mzYWSJV+ZI/BVpQ56 7rS24g6ZeYtsWRd4wDA9x3xiNRtXVIKD0KCzbQ1U+XZFr19PXzG7+UCOe/I4fz+PcNxB J9u5X/t34SKJeblu4POpL/XizEiqDsR2GZQ0g7u3KkUrqsAHNtwplsMUDBd3qB+3U9MG MXAxBJF+v2FUV1x5DL0iFSQ8lvjnEXsZf3AzRRzXcj9a7DJqUGWS81l9iApAavXJ4nAP E731NMIlQD1C6qeQqvfGPMrJky2NqKE6AAngtTk0l1Fyp1FPOYvMyrl6PYXghuLs8a9r XinQ== X-Gm-Message-State: ACrzQf2urXjz9JwWLeXCTDpx3rTm9ZY9raW4YUvv/9hYu5kQsyfNwW2C P9KMoRTmy4sdXdQvw/NtaZBTTsQFRVBQk2y+Ojk= X-Google-Smtp-Source: AMsMyM6dZGiRdcwBJw4f1h0Z+QfrrezbVrHC3PRIGo27zog9kqVzR6pkwDm1EIlP+k9FxULbaNSHW73bap8ae+8iTsI= X-Received: by 2002:a81:1e93:0:b0:35b:e18d:3015 with SMTP id e141-20020a811e93000000b0035be18d3015mr5373137ywe.163.1664923076674; Tue, 04 Oct 2022 15:37:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 4 Oct 2022 19:37:47 -0300 Message-ID: To: David Rodrigues Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000009048ef05ea3d1cec" Subject: Re: [PHP-DEV] Experimental features From: flaviohbatista@gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Heleno?=) --0000000000009048ef05ea3d1cec Content-Type: text/plain; charset="UTF-8" On Tue, Oct 4, 2022, 17:43 David Rodrigues wrote: > 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 > Hi David, Could this be done through extensions instead of having to develop a new process/support code? When json support was first introduced into php, it was done as an extension and then, after a while, incorporated into the core. --0000000000009048ef05ea3d1cec--