Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118742 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87606 invoked from network); 4 Oct 2022 22:47:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Oct 2022 22:47:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A45B81804AB for ; Tue, 4 Oct 2022 15:47: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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) (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:47:45 -0700 (PDT) Received: by mail-vs1-f49.google.com with SMTP id d187so16198779vsd.6 for ; Tue, 04 Oct 2022 15:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=Eo4gB750ufdyzXl8OjbPZqRn/UtcO7IHKNngsgLPZrE=; b=e3k5/puIZ6R8cCTmqohqPk6vqPJoGzdO0lcRd9yE3alQlH4C9Ux6Sa/YG1aFvHdD5Y 9hrSYjyetldrcLaIyX+YjL5NI5p5nyW/9RwstQh8p4SaELHFNE1u6Hv9CmbhUCdhzQBU 4rcyREwAcwL5Nin6tPSYD2ZSSq1TDV/mZtPVe5WOxjwVFvOiJGANtRGC/5e97TZW5hNO RIPa14GPidcQoqcwiKgIIhMJn32rsqunmgtkqne/HcuayyhQFk9ee+7UNmLM6KUNNfkJ G8Ct3/1TmXmSAbtKnpZGhV9oY0anAXcG/MYP6v9o9UfN4tFj8RfZX7AEX3VsGpq+0i6G iUUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=Eo4gB750ufdyzXl8OjbPZqRn/UtcO7IHKNngsgLPZrE=; b=kElYYaR6vT24k8MxUIRGLH/SFcUW0oZciFzdV1G6+x4a+R6FxnfRlMtIhTlsrtChsS mqx3h2qqhhDqw/2mmN95Dslk/4DYgJ0+7FfSVedUXL8+u9r+SJhy1lCnJW4KYggMr2Z/ EZTxLhj91r0Pk3pHIHykwUEVW8mJBBsCIE6E6na0RMyVl7Owa/A0YsaMlmLxKClFa2rf t7+QlpIbION1wbmG0e0pkmKfUPf1zegdRi+Ug/aCvDxGrcGvTkj3gyt0wbQM4mtUAgOX i5EOg3YD5yyvEpQH6OHo+s6Zh6R+IQmtdxC6vLqgp3xGy/WuEVl4YmIMSBbVjVlh7+r6 vVeA== X-Gm-Message-State: ACrzQf1axAD5296U7CCECQNWrb10lA6xm75tWvow4q0jhzA72Zt/E7pS HZDQHyW7tHNMZX0QuMYEhvDM0SbOxq3MueyOlRw= X-Google-Smtp-Source: AMsMyM6kHePQYTqx/Z1akA3YVCdqKy0Jn4aFkI2Eu7ilZMM+ziRxm5qhJYPuXFVbS7MLbtZbdL7323TvwlZu4sTgK78= X-Received: by 2002:a67:ef43:0:b0:398:8011:63bc with SMTP id k3-20020a67ef43000000b00398801163bcmr12635530vsr.59.1664923664422; Tue, 04 Oct 2022 15:47:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 5 Oct 2022 00:47:09 +0200 Message-ID: To: =?UTF-8?Q?Fl=C3=A1vio_Heleno?= Cc: David Rodrigues , PHP Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Experimental features From: divinity76@gmail.com (Hans Henrik Bergan) sounds like that's been done with PECL previously yeah? PECL json until native json_encode in PHP5.2.0, PECL PDO until native PDO in PHP 5.1.0, PECL ZendOpcache until native opcache in PHP 5.5.5 etc? On Wed, 5 Oct 2022 at 00:38, Fl=C3=A1vio Heleno = wrote: > > On Tue, Oct 4, 2022, 17:43 David Rodrigues wrote= : > > > I wanted to suggest the possibility of introducing experimental feature= s 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 ha= ve > > to wait for new major/minor versions (eg. 9.0 or 8.2, 8.3) to try out t= hese > > new features, and so when these versions arrive, they'll already be qui= te > > 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 readin= g > > the file itself. Eg. declare(experimental_operator_override =3D > > true), Something that happens with Kotlin, for example, when we use som= e > > 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 w= ould > > 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 experimenta= l > > feature, but ideas that have a good foundation and a good discussion be= fore > > 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 t= ry > > 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.