Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115967 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5637 invoked from network); 6 Sep 2021 15:32:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Sep 2021 15:32:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CA7781804DB for ; Mon, 6 Sep 2021 09:09:15 -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-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (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 ; Mon, 6 Sep 2021 09:09:12 -0700 (PDT) Received: by mail-ot1-f49.google.com with SMTP id x10-20020a056830408a00b004f26cead745so9288402ott.10 for ; Mon, 06 Sep 2021 09:09:12 -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 :cc; bh=T3oVv6n0g0LPfpTxpiMymQA/tS5NS9S3Vs2yaTWhHSs=; b=mbPGksbNEjvzYNVdpYkmm2GWCeZkxLX/ASaqUW3fAP7qDPs30WHct/EkXHTAEEdDBT G2fEFfKCsQkQLJ4DDNmYNHScY1Sxld9q34ZhCCFSDBsI4gZgA/1zODGkgg1X2fkmjnBW fzjM7NQeUQZG7bmgxW7OlwFf2ZSboDNldph1MDKcm54Pj4LVpyL0jDNmK0PkDHxf0rVO oh+0sd2X7E96+Qc3RIsn9r3Uc1Fg8ayZXgne8O1X9YbkZkDXnWwnjFwHU6I0Mpxt+pir YloWeTB0pjbjdbHexDZj7VHnu2LRUh8uziUZgvllyKt4WC49ypoMmwXXzNLAroVLcgF/ YrDQ== 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=T3oVv6n0g0LPfpTxpiMymQA/tS5NS9S3Vs2yaTWhHSs=; b=ltMB+4jNC64GRlnMdBUfdQMAYhtuBkF8P/Cev1pNtrjyJNMwDusPeQnt4bQ1ZJVY9H 2bnCqZfEK80DBTbKOl0iQt1YIc7+e3CQOMR1NV7aRbCn8wQRctsYuKt+Zsf1t0VufKJk UtSqBZ7i088ALmVtZpwbe42+2mEbx5EYvCCIWqsDymsmxE813/ABwtphaahzX0s6A5TB S/pzT2NOdMGmUTsy9GLAkfawnOWQ0FzDHwPoiR7zU4jjnwd2zjjJpbp/Xiix8AsgDmB4 IhYfT3k8o6QHBo7QdvfMANGy61QrbMilqjkVyA9T+bgZHGQPPZa3vUgvFQSTrBTseUHy IQ/A== X-Gm-Message-State: AOAM532zHOQp6nuPkJFotfqY4XSgIfOrZsIwXMNvq6JiIp0RuTuoOY7b csLsX1hefZkWJjVYt4Hz1VHLHfqLHnhP2wBVHqo= X-Google-Smtp-Source: ABdhPJx5k8M/9GS/rw56andudcaU/Brs7r64N6qvDXZUbiUEwHCIfMjo8rQQ8j31QVU5EMC40YAB6tz1+07w2w5XN2Q= X-Received: by 2002:a9d:490f:: with SMTP id e15mr11618413otf.340.1630944549745; Mon, 06 Sep 2021 09:09:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 6 Sep 2021 18:08:59 +0200 Message-ID: To: Nikita Popov Cc: PHP internals , Rowan Collins Content-Type: multipart/alternative; boundary="00000000000089378005cb55de30" Subject: Re: [PHP-DEV] Alias stdClass to DynamicObject? From: benjamin.morel@gmail.com (Benjamin Morel) --00000000000089378005cb55de30 Content-Type: text/plain; charset="UTF-8" Hi Nikita, Rowan, In the thread for deprecation of dynamic properties, Rowan suggested that > we alias "stdClass" to "DynamicObject" in > https://externals.io/message/115800#115802. I wanted to split this > discussion off into a separate thread, as this can be decided > independently. > > The rationale for this is that "stdClass" is something of a misnomer: The > name makes it sound like this is a common base class, as used in a number > of other languages. However, PHP does not have a common base class. The > only way in which "stdClass" is "standard" is that it is the return type of > casting an array to (object). > > The actual role of stdClass is to serve as a container for dynamic > properties, thus the suggested DynamicObject name. > > What do people think about adding such an alias? Is this worthwhile? Yes, please! A future where dynamic properties are only allowed on DynamicObject is bright. I would even deprecate the stdClass alias straight away, so that the whole thing can be gone in PHP 9. Kind regards, Benjamin > --00000000000089378005cb55de30--