Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118607 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65807 invoked from network); 11 Sep 2022 15:24:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Sep 2022 15:24:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 70C09180384 for ; Sun, 11 Sep 2022 08:24:26 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 11 Sep 2022 08:24:26 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1FE2D5C00FB for ; Sun, 11 Sep 2022 11:24:26 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sun, 11 Sep 2022 11:24:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1662909866; x= 1662996266; bh=IXLjIn101OFWDsX4PWoCT9wnZOftNQD4ilbGWfeazK4=; b=F y5I8joGVtH4oFUiCVF3yEDPGxBai2cA3BBKcOFGp8HGiMFyNHo/+1tcaPZelydjf kbYmuecsAIipRfxR4z+afgKOmxsDPDvSS4w2sEHKdE3IJQrCtbG5SZno7HKJcKiH DlyQ/I+mfIQ0ZiMmLv8xdjNCH7hlWKfiLVkb22kwHTuYPyYHiS2GLEW0z0gdUWFG nGumfwGF2ZLElSJRKu/NKM9fUPftZW4/4oMP8rv82BjEGVJKcbXsv3xPrvp01ynZ EMsDbpOnodCDIC6A0TVnluTbo9Q59i2dblme0YbDWxVhMEQBmYh/Lx3SQu9SQgWb Q8LYyDBLxwIaNA4h21iYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1662909866; x=1662996266; bh=IXLjIn101OFWDsX4PWoCT9wnZOft NQD4ilbGWfeazK4=; b=yQe5gZ/JduHxMqa7VCl4P73ERZPtyJxr6DarkmxCOA+c J1X/EwaIFbsnY8t+5e+wvMMqz8lHQBYKK6ojISoop2GBGKG9DdEP2O4B9pn8F61K Y6PEjQy5UduHIg/O5qX7Hi6CvOQgYPh9222uhpK8EiEX/jWL/y5+rFsd2CKDs3gs cHb9kLaL0qBeJSbSo4NPEW1Z4pyHHjj0XqzixhU+vt5qfOKeD5T5WuVt6VUTPd2I tox3MfyEjJWhs9yRIg0OfQZyl501YJceU19bLyAVw+qWIF3rq6cnz3bHUWV1a7fQ bXfTakZj/sRbKTsV91sOLsQiCf/0+KXjok6u6onsmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedutddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E541A1700083; Sun, 11 Sep 2022 11:24:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-927-gf4c98c8499-fm-20220826.002-gf4c98c84 Mime-Version: 1.0 Message-ID: <7930779c-1782-4ecd-8e3d-42ba9e199bdc@www.fastmail.com> In-Reply-To: References: Date: Sun, 11 Sep 2022 10:24:05 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Re: Issues with readonly classes From: larry@garfieldtech.com ("Larry Garfield") On Sat, Sep 10, 2022, at 4:34 PM, Nicolas Grekas wrote: >> Personally I'm undecided at the moment whether or not it should be >> allowed. I'm sympathetic to the "it's easier to disallow and allow later >> than vice versa" argument, but still not sure where I stand. The above at >> least gives a concrete example of where the problem would be. >> > > If we want the safety you describe, we might want a stronger version of it. > Let's name it immutable. An immutable property/class would be like a > readonly property with the additional restriction that only an immutable > value could be assigned to it (scalars + array + immutable classes.) But > that's another topic. > > Your example made me doubt for a moment, but without any convincing > purpose, this should help decide that child classes shouldn't have to be > readonly. > > Nicolas Another question I think is pertinent to ask: What kinds of objects generally would be proxied in this way, and are those the kinds of objects where a readonly object would make sense? Off hand, I'd expect this kind of proxying to be used mainly on services, whereas readonly classes would be mostly value objects. So the problem space may be smaller than it initially appears. --Larry Garfield