Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115813 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83091 invoked from network); 25 Aug 2021 13:30:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Aug 2021 13:30:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9CE4C1804DB for ; Wed, 25 Aug 2021 07:05:00 -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_H2,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-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (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 07:04:57 -0700 (PDT) Received: by mail-vs1-f54.google.com with SMTP id t4so9552890vsm.5 for ; Wed, 25 Aug 2021 07:04:57 -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=ZTyTDc67WGEaKxaYAHcWBpSBYrg1a4b7og8YzZlBchw=; b=UwQv/iNV9zDpGNyqnVzaYFE45Mqo/1oytFa6RidxXKBJHToBbpmsXrmkHTaqtDwaP1 WxPje9ZmipZPeHSXiG6vOpIZnr6JppKeAUFoh8WNTtnLKRsyT0d7MJ29Sy0POSjZ+ykZ XOpvWS1XhAa0WE/Ux1z6X4EiSBBJUINi0HlRMFSzXYLMJhsk9YtjVZ8EjvC6X2Mmh/gk 0KpCiKN6TRskRiWo/HnazMeDcCB8DsM8rJ4EgXUQ4rgNAZcsWnOogbJtJ6wQVg0CJaAw J/vA5Fc6FtosY8foULdsisYWvQV/DxYZpmZAq9oOSZn8chClJzeTQmIw+0h1iQNtQTgc CWhQ== 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=ZTyTDc67WGEaKxaYAHcWBpSBYrg1a4b7og8YzZlBchw=; b=qfmDHGqjd/Sr1kMa9cXr/BozXSt0oZRFf/MaNbaEaO54RFhE1+I0mV+jqwXHBGNHSG TlP43iQJkKafyxgNAf88ztV42zAeovzYdKzjOUSwdPU1Q2V1TqUi0kF4pzjKXoaSjTDV kt/d25807+Z2ULJesn+npIjqTbxcfOT0zLK15+friGmrGjEVw8p0gR3mnjmU8e5ssz9w DE67HW6s4ybx604K5e1gRrkWDFRrHqELUib0GaQLnWpli79aHXRRPS0PIXu396PcnhSJ D9vJSYqXCndvgeLivwqfKchLKhM5d1xYXhccSfMz1oCA5MDlhkLVUpXzCjp1E7kW5Etc G8lg== X-Gm-Message-State: AOAM531sQb7uIO57OHZSsn8yh1rW7IgOcD8fjAN6o5nqi+EKgWw9Z7Bu aL5lvn6OWAHg2Nrid2MGw5IMvPAiGAGskfVMqwo= X-Google-Smtp-Source: ABdhPJzKmdy/J0GVTpZcKzZuM8U5jdL29oXFtOyU1sVphSogiJcroywZcibBjuTK2KTYWXTFE6yqkrvc6I92nhXo5vw= X-Received: by 2002:a67:7104:: with SMTP id m4mr32825443vsc.44.1629900289842; Wed, 25 Aug 2021 07:04:49 -0700 (PDT) MIME-Version: 1.0 References: <763725c0-870b-e8c4-054b-1ea0481ef877@gmail.com> In-Reply-To: <763725c0-870b-e8c4-054b-1ea0481ef877@gmail.com> Date: Wed, 25 Aug 2021 10:04:38 -0400 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000cba0ba05ca62bb78" Subject: Re: [PHP-DEV] [RFC] Deprecate dynamic properties From: chasepeeler@gmail.com (Chase Peeler) --000000000000cba0ba05ca62bb78 Content-Type: text/plain; charset="UTF-8" On Wed, Aug 25, 2021 at 9:51 AM Rowan Tommins wrote: > On 25/08/2021 13:45, Nikita Popov wrote: > > > We obviously need to keep support for dynamic properties on stdClass, > > and if we do so, I would expect that to apply to subclasses as well. > > Does that actually follow, though? Right now, there is no advantage to > extending stdClass, so no reason to expect existing code to do so, and > no reason for people doing so to expect it to affect behaviour. > > > > Second, I consider "extends stdClass" to be something of a last-ditch > > option. If you encounter a dynamic property deprecation warning, you > > should generally resolve it in some other way, and only fall back to > > "extends stdClass" as the final option. > > > That's a reasonable argument in terms of the multiple inheritance case. > > My concern about the name remains though: people already do get confused > by the name "stdClass", because it's not in any way "standard", and > tells you nothing about what it does. > > Reading "class Foo extends stdClass" gives the reader no clues what > magic behaviour is being inherited; "class Foo extends DynamicObject" > would be much more clear. Similarly, "$foo = new DynamicObject; > $foo->bar = 42;" is clearer than "$foo = new stdClass; $foo->bar = 42;" > > Regards, > > -- > Rowan Tommins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > Please don't do this. Call it bad coding practices or not, but this was something I've considered a feature of PHP and have actually built things around it. It's not something that can be easily refactored since it was part of the design. -- Chase Peeler chasepeeler@gmail.com --000000000000cba0ba05ca62bb78--