Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116263 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96289 invoked from network); 12 Oct 2021 09:38:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Oct 2021 09:38:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C24C91804DB for ; Tue, 12 Oct 2021 03:24:08 -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.2 required=5.0 tests=BAYES_20,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,T_SPF_TEMPERROR 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-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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, 12 Oct 2021 03:24:08 -0700 (PDT) Received: by mail-ed1-f43.google.com with SMTP id a25so63306745edx.8 for ; Tue, 12 Oct 2021 03:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=QiXhe20xV5MSy7X0ouKAwvVG6cobWMasQNDMwr3wQHM=; b=Lh0hW3xQYvmoyghK/UNiCgGS8reQ0sHO5c3VrTLEzpoFqzyO/34H4yHBEZwVrIHauO B57muWPeGFtjt3NGPgRLdXM47YBm5osfMvr5IhnmLfsz7hgGBPT9CTVU03aWR3398AmX SRokqXKNToV2miNHP5Ge29z6Ua691CgpkmMD3yL1zP4N/TldEHSKK8srFZWgwgn08FJj N/I1qleBG8TWxUpeXUNF2yTCct6kpZRfeTLU2iYDafNUSU2NjtPR86UGbMzQKIkh8bKM 5SaK8tEq1Q8GvEdlIjXmm88QXXnheR/gWRV2HrXb5CJgk3RsIJdUysXmWyM+ffiUR+JT LJkA== 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; bh=QiXhe20xV5MSy7X0ouKAwvVG6cobWMasQNDMwr3wQHM=; b=ranpr7fdz7zrFR5a0mzVjUMd5qEEWSoTJO3i7n2/PfNgf1KcMBKVig7ZhdKkHrWLh/ krj95YMlObYVtwP6Adk05nduooLW4W1sRhyfDcDzO+a+sRvR43Ud/p0WLELJbHQrCdfi RkWp+8jGhGnU/U5JmmC0a1rrwSBDgZZGdbSANSr8++N2ZsmhRZd6sNCDPVibQqu0yeRA 1mxmnV8tv/G3MkedY+NIgi66EXWTGmbieUl684fwPPCO4NLJdy+TMGJ/igFFDRDGBj6B IlfTWjfT4PDwMkZXucs6Y+QMhGBVe4nUoerJpH6/D6DzMLkBMT4S+NV/oGNs2rx8thxb iqAA== X-Gm-Message-State: AOAM532vdOuzDzkxwbkkkATgTjxf8OTHFlGmdadjiJ178+/hv1C5OtOo MO5DDg80ZNmvx9UE6liRrCqa09OqmLgOkfLCNeZ/3HsO X-Google-Smtp-Source: ABdhPJxwjXLhFIWe1j5JLeqOp5W+/MBSWtNJnyUhofX7GLhwq7Bfu2XuWmO6YwK3z2oyXqllmW1tHqkVlnoYq8YeHtk= X-Received: by 2002:a17:906:1dc4:: with SMTP id v4mr32158771ejh.282.1634034246002; Tue, 12 Oct 2021 03:24:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 12 Oct 2021 12:23:50 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000c8aa8c05ce253ef5" Subject: Re: [RFC] Deprecate dynamic properties From: nikita.ppv@gmail.com (Nikita Popov) --000000000000c8aa8c05ce253ef5 Content-Type: text/plain; charset="UTF-8" On Wed, Aug 25, 2021 at 12:02 PM Nikita Popov wrote: > Hi internals, > > I'd like to propose the deprecation of "dynamic properties", that is > properties that have not been declared in the class (stdClass and > __get/__set excluded, of course): > > https://wiki.php.net/rfc/deprecate_dynamic_properties > > This has been discussed in various forms in the past, e.g. in > https://wiki.php.net/rfc/locked-classes as a class modifier and > https://wiki.php.net/rfc/namespace_scoped_declares / > https://github.com/nikic/php-rfcs/blob/language-evolution/rfcs/0000-language-evolution.md > as a declare directive. > > This RFC takes the more direct route of deprecating this functionality > entirely. I expect that this will have relatively little impact on modern > code (e.g. in Symfony I could fix the vast majority of deprecation warnings > with a three-line diff), but may have a big impact on legacy code that > doesn't declare properties at all. > > Regards, > Nikita > Based on the received feedback, I've updated the RFC to instead provide an #[AllowDynamicProperties] attribute as a way to opt-in to the use of dynamic properties. As previously discussed, this won't allow us to completely remove dynamic properties from the language model anymore, but it will make the upgrade path smoother by avoiding multiple inheritance issues. Especially given recent feedback on backwards-incompatible changes, I think it's prudent to go with the more conservative approach. Regards, Nikita --000000000000c8aa8c05ce253ef5--