Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115977 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31575 invoked from network); 6 Sep 2021 20:05:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Sep 2021 20:05:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 17C791804AA for ; Mon, 6 Sep 2021 13:42:27 -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=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY, 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-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.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 ; Mon, 6 Sep 2021 13:42:26 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id x27so15335083lfu.5 for ; Mon, 06 Sep 2021 13:42:26 -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; bh=BBLpl+Li6dLrgEzXRILFrZwbinpMdDtRfZ62EXv7L04=; b=LSX7vfQrFF28pyyI1egtuCYt3O3T9tnCvPq100M5RuynaWvvq1m2KWtrsnMqB8Yxf1 c6mmdM7a075OmmIEwAtf18AVYzVwcjaXeBoIpQAeRJXQ+Tyq56SGCZ/ldGUhI/+173Sy SEewz4TtGfYosngaD1ehSWnz+pUd0bhRwhiC7xv3g1r0a708z8dveS3dJYLujEA5XHh0 csEGLN1GnYTrhxE8dPYYly1WZIBNJOqIJMOefLnK8yOwrIUtywc907g5KVGZpz83pLs3 v9xqwGD18nIGt/zvavPUxo1EyXI27VUu79kiWA6IkRqz0eNENJwxgXN6nvXIfiKli/42 QhPw== 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; bh=BBLpl+Li6dLrgEzXRILFrZwbinpMdDtRfZ62EXv7L04=; b=LbGm2A0g2VKUcRR12bzNgzRwwyMGNAubh8FgfxAfmNyWuQbm2SKeLi35C3bXN8EVXr 2CGMjmrP21QiOfm09PuHQelOYvJq1PuF7Xh2SuoGeBbBVrIhXJ/rEjg0j7EE2gwA4uAx 14RGcEHXaFp/VPLVEsugPphz4g+Hy37z25mbwS0SFzDja8xf6sgHnHpnYx0K8zBuZd6V ropNCGQYJ443mpcPzoY+YNw/iZ1wOYV3Zq7uiUDzE27xy55MnEhEtiyR+VSGG8SYHUsR OzoCiV53pboNzdG+keLOp+vGh9NLx7eCNbWbWaUP5BgRIysWlj3B16hQeleKwJECClzV 1YMg== X-Gm-Message-State: AOAM530iSucVu5CSg7sgY8H6LdhghBindkCj71W7CrixZgiK2DIpTtNy pFkL2Rj3KGJBjJGFh8UB1xYyQIWHG8TG+QcTUbjX0c5k X-Google-Smtp-Source: ABdhPJzUfgyaiOGRcQzTR8vPhW6/z3D1n2aa3vaHekjduUGHopgKck85C+GOjTJL8azSeojw7+ZxWdBmNBX8mrJHfwE= X-Received: by 2002:a19:ac4c:: with SMTP id r12mr2917152lfc.414.1630960944905; Mon, 06 Sep 2021 13:42:24 -0700 (PDT) MIME-Version: 1.0 References: <6908b343-b8ff-9173-5714-1c97b23ed6e6@telia.com> In-Reply-To: <6908b343-b8ff-9173-5714-1c97b23ed6e6@telia.com> Date: Mon, 6 Sep 2021 21:42:13 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000c3831605cb59afb0" Subject: Re: [PHP-DEV] Alias stdClass to DynamicObject? From: cdtreeks@gmail.com (Aran Reeks) --000000000000c3831605cb59afb0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Creating a new DynamicObject class which is the preferred alias for stdClass sounds logical but I too share the consern around making it the default anytime soon. Too much code depends on an expected type of stdClass presently which would likely make future upgrades more difficult for no functional gain, beyond some added clarify. With functions such as json_decode() still returning stdClass by default, this is the main bug bare I can forsee where we commonly strict type passing the decoded value throuh to another method or type. Would be nice if in the future you could specify a class to populate instead of stdClass - just a thought. I too share the same view on deprecation notices being enfored and although this would probably warrent its own thread, perhaps there benefit in resolving this in itself under another RFC where a new php.ini directive, or method call could be used to silence certain specified deprecation warnings for those that are aware and understand the changes required in the future so can knowingly make a decision to mute them. On Mon, 6 Sep 2021, 18:50 Bj=C3=B6rn Larsson via internals, < internals@lists.php.net> wrote: > Den 2021-09-06 kl. 18:22, skrev Christian Schneider: > > Am 06.09.2021 um 18:08 schrieb Benjamin Morel >: > >> Yes, please! A future where dynamic properties are only allowed on > >> DynamicObject is bright. > > > > I have nothing against a DynamicObject alias for people who like to be > more explicit in their code... > > > > Totally agree here! > > >> I would even deprecate the stdClass alias straight away, so that the > whole > >> thing can be gone in PHP 9. > > > > ... but I'd prefer retaining a backward compatible version for library > code, at least for a while and preferably without warnings :-) > > > > - Chris > > > Couldn't agree more on the statement "without warnings"! > > I mean if one have code that is in production, is running perfect and > one wants to upgrade to the newest and fanciest PHP version and the > logs are flooded with warnings for a deprecation with zero impact on > functionality. What do one do? Maybe just turn of the warnings for > that code section / library ;-) > > r//Bj=C3=B6rn L > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000c3831605cb59afb0--