Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115811 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80058 invoked from network); 25 Aug 2021 13:17:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Aug 2021 13:17:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 981971804AD for ; Wed, 25 Aug 2021 06:51:12 -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.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, 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-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 06:51:12 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id n5so24216432wro.12 for ; Wed, 25 Aug 2021 06:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=cxID9cPvU4SWzbTfNWo+o6O21Ai7pqn0mUIQWBG7p+Y=; b=ij56NFFyWOB3+HQf0MihjlKCRnazH+h0xqlNb0sS0chH7/VyRuGWjAeHkGC6CocOcF cNZQfttzWBMZx/zHnFXRZjfpbobDFPZYp9jKjmjsi/ZcsGkPqHITJ7BMbdwid39HjusL egv3DwOZY0cjLFfpBEsTC3W2CLoOWo/BOV/LmTVhdI17EIf2XvKGk0xnATArm5hKc0jt G8UaqkXGv75pC6MAfRROdancneENXu1FlHTW/MkorAXEm+xjKn/RuoLhchCBrrOkxhi/ GI1PkyCrezZBfaL+52/8RINe8IPhIQtkBasH0fwbJRaAnsgc8H4kIBIiEhN2FMfcJsGl wuqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cxID9cPvU4SWzbTfNWo+o6O21Ai7pqn0mUIQWBG7p+Y=; b=ufESy3ohOs2wWPHMrWgxYzkGf/iY0bddzKhp09WZ0Fi994ti6wSmK2yXGvVEZa4ZQv ljo9f7hi0vjUztYjGaSngU+4iiTG0od9OnfzI+tqcWnqcNcfFzySzh1DkZaW24EnL2k+ CRNNVm1wDTeFsfjg2PGabxJYkcXwPwzXwkrag0WQOvQU8ZB01rYxO8vqfnKsXS7DtEtK 008cXz2kDqzjwxAIsDWI9nY2y2ir6PzIqIIhO6tbVhHXI5cwV2d/SB5VlDojikBWp1cM 8YzmwbrvIcmO2co0+uYYcXRHUkcsf9sAr9bHKE5uENzUG0/MZqlpg6b8i0cf4negL3FC BU2w== X-Gm-Message-State: AOAM531fJLKrVeEbWUOvzqp15QP+gvlkiM0RQDSIQa/eea6rX8kza7NX 2fzdLHWMrmVODGnOgAzYKfd90HvX/YU= X-Google-Smtp-Source: ABdhPJzVh/owEk4SjMeh4RMNT/XT6Dqdsv86dWUodfwmJAkSWnYh4QqRp+cNN/Y28S0mNqUUeAIe7Q== X-Received: by 2002:a05:6000:1569:: with SMTP id 9mr17055113wrz.242.1629899470887; Wed, 25 Aug 2021 06:51:10 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id u27sm2047222wru.2.2021.08.25.06.51.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 06:51:10 -0700 (PDT) To: PHP internals References: Message-ID: <763725c0-870b-e8c4-054b-1ea0481ef877@gmail.com> Date: Wed, 25 Aug 2021 14:51:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] Deprecate dynamic properties From: rowan.collins@gmail.com (Rowan Tommins) 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]