Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115804 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61569 invoked from network); 25 Aug 2021 10:18:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Aug 2021 10:18:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B4B3A18053E for ; Wed, 25 Aug 2021 03:52:35 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS 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-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 ; Wed, 25 Aug 2021 03:52:35 -0700 (PDT) Received: by mail-pl1-f179.google.com with SMTP id a5so14095425plh.5 for ; Wed, 25 Aug 2021 03:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fUFA6DEulPB8sENl7PATF2YRnXy+fi0ujZclKWY5ehs=; b=AqAmS809CLAHFXZR3jizgHn6J1fTXvGYhD0ULRM8dWCqz8zrenJf2e/d4KJpVEA8Ed tcM2UHzpwnWUs8u9PEm4QflKwmSy10TG6a0/bnW/WyWL9o6L5lJACdIP9ICV/BgsMeKe EhbFswL0bXhG9cMPjCeqsFH2DnqbpVu3cx/UCxoFJIzA5BLIdFJantRZ07qiSEjTOYa/ 2f5ZEDp+H87feR8sCayQMMqXgXNSzF2HO5S9HUGzqm+Zx1WL0v+3ETYgSceZFXN8+0s/ 7DRkmkxOM8hC70igAg7yvzItCVQcQCQg48j4wmDwN013eqMUrq28s4+0NUxnAtYV9L16 l8Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fUFA6DEulPB8sENl7PATF2YRnXy+fi0ujZclKWY5ehs=; b=KhcEEuiI/MrDvXg2gml+flodyQfVg35YSSywKp5UMxakhABTXdB2EXgX3iXYD6jOsM raLodBWPscv3l31A5YyF2DIvwgxmRboNjoS5QOlgtOekRp5+2XtbdqaYjRr3OHfYHJ0j JniqPnLtl9EBxZffbx+Ba0tO5bSeTZGnc9nr9a2/Hv71HBqmY27mzAjo40+JYtTGxsMu j876cmKFeokU9HbrxZh2WDWhtq/ZxZu8ANZOW8+6sS4pFIo8mJzmsdJM9UQnPAqL1NLh qb0fwMglCvm5S2eRaZhdONkKFS2Dnv8lOB9HV0H10IgW2UpHIzsDu5A1LS/XLHXYQBa/ Zodw== X-Gm-Message-State: AOAM533pO5AcQ74253wQOAVm47Gnq09uEtPU2XpcH3TGEkneKNgIPxpv bDexPdL8oWH5ZDlTCgzAFFlyufiYNK0hy6NYhA0= X-Google-Smtp-Source: ABdhPJxH1JrRXgcTOy3VT2hx4RfxkPsV2qw8yP/s7632Im1huIht4HzzX9GftlLHef5ByYuYfSdB6jL9llkPSxoz+TA= X-Received: by 2002:a17:90a:1990:: with SMTP id 16mr1690593pji.11.1629888754175; Wed, 25 Aug 2021 03:52:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 25 Aug 2021 07:52:22 -0300 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000003751b805ca600ca1" Subject: Re: [PHP-DEV] [RFC] Deprecate dynamic properties From: flaviohbatista@gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Heleno?=) --0000000000003751b805ca600ca1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 25, 2021 at 7:46 AM Rowan Tommins wrote: > On 25/08/2021 11:02, Nikita Popov wrote: > > 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 is a bold move, and in principle seems sensible, although I'm > slightly scared how many places will need fixing in legacy code bases. > > I have a couple of concerns with using stdClass as the opt-in mechanism: > > * The name of that class already leads to a lot of confusion about its > purpose - it's not actually "standard" in any way, and new users seeing > it as a base class are even more likely to mistake it as some kind of > "universal ancestor". Would it be feasible to introduce an alias like > "DynamicObject" which more clearly defines its role? > > * Adding a parent to an existing class isn't always possible, if it > already inherits from something else. Perhaps the behaviour could also > be available as a trait, which defined stub __get and __set methods, > allowing for the replacement of the internal implementation as you've > described? > > > Regards, > > -- > Rowan Tommins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > Although not having voting karma, I'm +1 on this. I've always preferred explicit over implicit code as it makes the learning path to newcomers a lot easier to grasp. When we talk about legacy code, more frequently than not is that legacy code is unlikely to run on the latest version of PHP, thus I'm not entirely sure if that's a super strong argument against it, but I may be missing something. --=20 Atenciosamente, Fl=C3=A1vio Heleno --0000000000003751b805ca600ca1--