Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116431 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61795 invoked from network); 16 Nov 2021 23:00:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Nov 2021 23:00:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 08F05180546 for ; Tue, 16 Nov 2021 15:55:41 -0800 (PST) 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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE 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 out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 16 Nov 2021 15:55:40 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C44E25C0228 for ; Tue, 16 Nov 2021 18:55:39 -0500 (EST) Received: from imap43 ([10.202.2.93]) by compute6.internal (MEProxy); Tue, 16 Nov 2021 18:55:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=kKyLxm Gi9PXevKoEqyuMGGLaEenxEdMK+L3wnyFQft4=; b=hgYPL6T4BatX2RxBO99MHZ zxcG3RQf/dMchpYNMDGkyf4IMzNlRSJcqCw86Nde5bqBPXr+0al2oNsdDonfaMBM 17pdnbvnh20544EFZ4yTL8ODWbi4HnoZgCEkbgpjYPM5cMIaRNfaFVJUsfY9R1cE vpGbtjbRXC723JAhn/LGgRNUGEsRGGeVLbno2+8D5TY6FJOJvZVe8/IGV7LsvWT9 o/h7YLxvVYjGXeHXv2E+m9jgBGMkQBMapsM/4KDNHneyRYAbPA3pakJIC/pdKdF1 DbzIxDaLNBS/bATm3ZL2+PuXIncy0oxJB2nsn7O6O42SFK+vlrs6izfeN+n3BApA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeefgdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefgffek udevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 89AFFAC0DD1; Tue, 16 Nov 2021 18:55:39 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34 Mime-Version: 1.0 Message-ID: <62c884b8-813e-43b2-b7bc-db87d4b05f9b@www.fastmail.com> In-Reply-To: References: <371ca983-2b07-ae39-3629-49cf7ff8ee64@heigl.org> <497ab532-a39d-389c-8bca-86768650c2f4@heigl.org> Date: Tue, 16 Nov 2021 17:55:19 -0600 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties From: larry@garfieldtech.com ("Larry Garfield") On Tue, Nov 16, 2021, at 4:10 PM, Sara Golemon wrote: > On Mon, Nov 15, 2021 at 11:21 AM Larry Garfield > wrote: > >> A possible idea to help make this transition (which I do support) more >> gradual: >> >> Instead of an "allow" attribute, introduce a boolean flag attribute. >> >> #[DynamicProperties(true)] >> class Beep {} >> >> The attribute marks whether dynamic properties are enabled or disabled via >> boolean. If disabled, then they're an error if used. >> >> 8.2: Introduce the attribute, with a default of TRUE. Exactly zero code >> breaks, but people can start adding the attribute now. That means people >> who want to lock-out dynamic properties can do so starting now, and those >> cases that do need them (or can't easily get away from them) can be flagged >> far in advance. >> 8.something: Change the default to FALSE. Using dynamic properties when >> false throws a deprecation, not an error. People have had some number of >> years to add the attribute either direction if desired. >> > > This is exactly what Nikita is proposing, except that instead of the > attribute being introduced in PHP 8.2, he's proposing to introduce it > EARLIER. Roughly PHP 2 sort of timeframe. > > This is because attributes are forward compatible by design and developers > can already start adding #[AllowDynamicProperties] to their code NOW. Even > their code that was written to run cleanly on PHP 5.6 because users are > terrible at upgrading their servers despite a 2x performance increase. > > > The point is, we don't need 8.2 to be a soft-launch before deprecation > because precisely nobody is prevented from adding this attribute > preemptively. > > -Sara It's not *quite* the same, although your point about preemptive attributes is valid. 1. If we adopt the RFC right now as-is, the market has ~12 months to add the attribute. If we instead have a default-true flag that changes to default false in the future, it means at minimum 24 months in which to add the attribute to opt-in to dynamic properties. 2. The RFC as-is has no way for developers to opt-in to actively rejecting dynamic properties. They'll get a deprecation, but... we're shouting from the rooftops that deprecations shouldn't be a big red warning, so if you want a big red warning you can't get that until PHP 9. With the flag attribute, developers could opt into "please slap me across the face if I use dynamic properties by accident" in ~12 months when 8.2 ships, rather than waiting 36-48 months until the likely PHP 9 release. So it gives the nitpickers what they want sooner, and gives the old-codies more time to get their ducks in a row. --Larry Garfield