Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109064 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73373 invoked from network); 16 Mar 2020 17:19:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Mar 2020 17:19:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 295D41804E2 for ; Mon, 16 Mar 2020 08:41:32 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 16 Mar 2020 08:41:31 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id AEF685C0392 for ; Mon, 16 Mar 2020 11:41:30 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Mon, 16 Mar 2020 11:41:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=SEwIlplkWBfqM2/vQNxkJlK7TJxJbxCWYDjFGo+L6 D0=; b=odTY+ps/IcP8VbArszxTNLBxcHHvh4h3N5j7nG04i+EQwtrWsLeoRjK0p kpR8hDTALfUDVoM0B7jJei5VkBa3t7/HZEMui2WhBdJVZ61dMJMtEf4oYdh+Ys3o dJI12OJ2AvBjsv7PI/rYTgbyR1cGpKjEy81Yzk11dlYKMC7D1C7qURMk+i5nqJi4 pdR95bWDHQcih+bB78x6RDgDYxga5Vs+6HcPlVUdNJj7lMJhI638mI53ZiYXu5FW Hs0fV4OicUtZdJEp1PTnL8ipird0GlGz1hpdeBUx04CPUe1F4Y95jZz8DiqmDren CK/fDszWTVoj9igkuKgqK24C8zTVA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeffedgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuffhomhgrihhnpehphhhprdhnvghtpdgvgihtvghrnhgrlhhsrdhiohenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihse hgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2D9CF14200A2; Mon, 16 Mar 2020 11:41:30 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-991-g5a577d3-fmstable-20200305v3 Mime-Version: 1.0 Message-ID: <602d1a26-4a0d-40fc-bf37-2019c6578d6e@www.fastmail.com> In-Reply-To: References: <8545d15e-ddd5-42be-8405-09697a077234@www.fastmail.com> <4d9688fe-cc57-44af-903e-05f4cbb1bbcc@www.fastmail.com> <6bcbf0a5-92d8-4cfa-a00f-e0e967fc037e@www.fastmail.com> <700327df-45d5-47ca-8828-d7ad9c9bee2e@www.fastmail.com> <6f2e7718-5d78-4c57-8da9-f8dd44cc9e7b@www.fastmail.com> <421993bf-821c-4ebf-802a-be9814b30b90@www.fastmail.com> Date: Mon, 16 Mar 2020 10:41:09 -0500 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Immutable/final/readonly properties From: larry@garfieldtech.com ("Larry Garfield") On Mon, Mar 16, 2020, at 6:57 AM, Nicolas Grekas wrote: > Le lun. 16 mars 2020 =C3=A0 12:52, M=C3=A1t=C3=A9 Kocsis a =C3=A9crit : >=20 > > > > > > The other one is the recently declined > > > https://wiki.php.net/rfc/object-initializer. As it basically works= by > > > first > > > creating the object normally (including a possible constructor cal= l), and > > > then assigning the specified properties, this would not be compati= ble > > with > > > readonly properties that have defaults. Other implementation appro= aches > > are > > > possible though, but may not be easily reconcilable with the need = to also > > > call the constructor. > > > > > > > I think what I'd expect from a possible object initializer feature i= s that > > it > > can't overwrite "write-once" properties with default values. (?) > > > > However, I'm ok to to remove support for default values because of t= he > > possible > > problems outlined (confusion for end users, uncertainty how it'd wor= k > > together with new > > features etc.). It seems that the replies are more on this side, so = let's > > be a bit more > > conservative than I originally wanted to be, so that we have more fr= eedom > > later. > > > > Actually, I have already updated the RFC with this. Also, I made som= e > > clarifications > > in connection with serialization and the usage of resources. > > >=20 >=20 > I repeat what I wrote before but all those problems would disappear if= we > were to bind the proposal to visibility: > https://externals.io/message/108675#108753 >=20 > We could even consider splitting "read" and "write" in two separate > keywords, each bound to visibility, isn't it? How would 2 separate keywords work, syntactically/visually? I can see h= ow it would solve a larger cluster of use cases, but I'm not sure what t= he code would look like. :-) --Larry Garfield