Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116427 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45132 invoked from network); 16 Nov 2021 21:16:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Nov 2021 21:16:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E9CE11804BC for ; Tue, 16 Nov 2021 14:11:02 -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.7 required=5.0 tests=BAYES_05, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL 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-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 14:11:02 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id bu18so1545334lfb.0 for ; Tue, 16 Nov 2021 14:11:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yUtilxDhEcJw5ektheu6NmBtLjlx8LI5Zo89o3GuQfI=; b=NafnyWgJS1hyND0RRR/4Pw9clKo6G7roef2C0+NTmOYH00Y+xWMr8tZQvVNwBmmtXh AsMdrIzkIE0k2FcLH5HsSdmgiIL9plX9fHHMDgNbGxHfyN4AgdN7AYd5brKiqRngknjU xFaN1Ik/BOWJGpuHnGRg8cu36/68YM2VfC4lovk3dcM0dL0ESuswSZdpLmPsucfIX+qb Z4M6U60ETlfx6iu9SLJxkbXAvEv3OU5GpWnSmbnJovkUXaGCvXwLa0MDS8bVSdOCiH+q V+d1b6FBbvhej2nF5dVL5JNZIYED338SBtakfewSLye95oyXgtvQ1C2g+ojBwrkE1i4D eLwQ== X-Gm-Message-State: AOAM533oolBn7/aIqFB6ugVnPzSX/wZXlgybZNKWNuMvPklx+5MELVyZ 1RuChU+oGEb2Yx9KjIo7mjM2wRYCmMoBLFnbbMPZcOtTwp4Kq+tR X-Google-Smtp-Source: ABdhPJx4PaxtsoMnGkwzwCN8PVa+7vCHx9QIDkxIeGvckKo3yEjTywCbFBpeQWIldH0gTcSSX3WUSZ8S6YLVCLRQMss= X-Received: by 2002:a05:6512:30d:: with SMTP id t13mr9852881lfp.305.1637100661047; Tue, 16 Nov 2021 14:11:01 -0800 (PST) MIME-Version: 1.0 References: <371ca983-2b07-ae39-3629-49cf7ff8ee64@heigl.org> <497ab532-a39d-389c-8bca-86768650c2f4@heigl.org> In-Reply-To: Date: Tue, 16 Nov 2021 16:10:49 -0600 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="0000000000005d19e205d0ef3378" Subject: Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties From: pollita@php.net (Sara Golemon) --0000000000005d19e205d0ef3378 Content-Type: text/plain; charset="UTF-8" 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 --0000000000005d19e205d0ef3378--