Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116007 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 82594 invoked from network); 8 Sep 2021 09:30:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Sep 2021 09:30:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 45E32180504 for ; Wed, 8 Sep 2021 03:08:24 -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-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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, 8 Sep 2021 03:08:23 -0700 (PDT) Received: by mail-ed1-f47.google.com with SMTP id g8so2110102edt.7 for ; Wed, 08 Sep 2021 03:08:23 -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=Zl/QvJCfhjMuYpnda9ro5e1EwOyjS+sRHrVcMV6GA90=; b=hkfrLPH4Bgz2OCuwxKTVuuOB5pcso6nghXBvpVPWOZ4xiTxzqw/98A6bQOgvx4P4Dt 7HqrDZFzmFABo6KXc4PdXf95z/HF/v67npm/qtbzjA/cRSJI17sdglCOVa/6uOgVy66n NFbQC6exQuYW1CBs60IIiiyuQs9wPjMSbwDnXkDOlvYHH/rLEhhBzUMJfj0fFSChToqP c8hghXQVZWgVT8aUTDXKAhTQMyL9VsyaCggUh6L5rvd03BvlmKKt3SLWzteZnsj6C5Ga gkWy3bedw7inHyTmYVcLLDAWlKUTsi90Fb4wkk2oIsX+3d+l0xFPTPR09f8amhoClWlC G0Bg== 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=Zl/QvJCfhjMuYpnda9ro5e1EwOyjS+sRHrVcMV6GA90=; b=NPAl3aFbmrn9opJzn+8TzfJMxJDORk1vTuspnx2FTEMqktnN+wFNcKHGugynI8esA6 DAHxMt9kj7+rsLHxmjHvGhRPbQV9AeasTF2z+oRp/yUUKj/hOU8QHJINVZbL7hdo5DUw O2XDTgRDFVSwlDPwTzahYIp7PJjPW4/lJfeX9R6W40dzbVeOYpoxIknNVrF18UIqF9F5 YIJcaAruUQPIOQz+43VKkYHgvfldKMlX+iAzPK3W2HsgaPNHIwUkGwXieYCFXkyflszQ LrX+VoZCLMkEaqbnVtV2MuMz6e9QxLMkHBSk6ZFu5HyqlZP/jX0XAe3tLQ0JcLCK89re I2tQ== X-Gm-Message-State: AOAM533wNDnWLXO8JnKOBvFGeFqr9J++ccJRngj16t+iaXUtOh0P9Ufz a362m6oJfbBF8hFJ6/V1a1vUIXpbFDGa/y9bx7jzEPydAkKf9w== X-Google-Smtp-Source: ABdhPJyLWpax/AZY41Uc1hK9IhFtVdcqVznrD9GAoRRe/EQElhUfmXm908vgEex51yiz+TXLT7SO3vLUJIZxO485FCY= X-Received: by 2002:aa7:d947:: with SMTP id l7mr2986134eds.105.1631095699608; Wed, 08 Sep 2021 03:08:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 8 Sep 2021 12:08:06 +0200 Message-ID: To: Nikita Popov Cc: PHP internals , Rowan Collins Content-Type: multipart/alternative; boundary="000000000000c5169f05cb790ff2" Subject: Re: [PHP-DEV] Alias stdClass to DynamicObject? From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000c5169f05cb790ff2 Content-Type: text/plain; charset="UTF-8" > 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? > Hi Nikita, Rowan, I'm reading the discussion about the side of the alias. Can't we solve these concerns by making DynamicObject extend stdClass instead of aliasing? That wouldn't allow an stdClass object to get through the DynamicObject typehint, but that shouldn't be an issue since no such code has yet been written, isn't it? Nicolas --000000000000c5169f05cb790ff2--