Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114295 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50894 invoked from network); 7 May 2021 22:09:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 May 2021 22:09:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 28075180211 for ; Fri, 7 May 2021 15:16:18 -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_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 ; Fri, 7 May 2021 15:16:17 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B3DB45C0064 for ; Fri, 7 May 2021 18:16:16 -0400 (EDT) Received: from imap8 ([10.202.2.58]) by compute4.internal (MEProxy); Fri, 07 May 2021 18:16:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=cSjlAU VYmuWRB4GPRrLFIa9sR8M2oNsq+5pGspNyaNw=; b=hsv/dV9CXtkCu1dkF8Udv4 2a+8F4DOMuZY2BHROp07sWf0X/+/pzEUZ12WGb6pMtoagaj6ZyjcWXrYG+uM3ffd HKXcEiL4T+MYbYwCS5gQMfvvSuv5W5z/xP8bnjP5x/waC1wS9g51xlMUpwfEZyLd HsRhj9Z8b/wseRfuk/2fDUWsphCxLYQilpb1MDw0+IhvaxGjlKKrCWc1uNOb0mHH uItBK8hrlHnZ2yMB4krjANfGkaTstPa6fy0gJh4V3J7OwRC5tV4ss9DAiOqfgxLp 9mBfehEZwPrXtli9CmVGhr8EisVALAi4qrWrQTNWnm6v3dlrutBjL+pksn+mZDTw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdegfedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeevheehvdevjeelvdevgfelvefftdejkeelvdekgeeh fffgiedvjefhhfeltdduteenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhi vghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4455E3A0192; Fri, 7 May 2021 18:16:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Fri, 07 May 2021 17:15:55 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Property accessors From: larry@garfieldtech.com ("Larry Garfield") On Tue, May 4, 2021, at 5:33 AM, Nikita Popov wrote: > Hi internals, > > I'd like to present an RFC for property accessors: > https://wiki.php.net/rfc/property_accessors > > Property accessors are like __get() and __set(), but for a single property. > They also support read-only properties and properties with asymmetric > visibility (public read, private write) as a side-effect. > > The proposal is modeled after C#-style accessors (also used by Swift), and > syntactically similar to the previous > https://wiki.php.net/rfc/propertygetsetsyntax-v1.2 proposal. > > While I put a lot of effort into both the proposal and the implementation, > I've grown increasingly uncertain that this is the right direction for us > to take. The proposal turned out to be significantly more complex than I > originally anticipated (despite reducing the scope to only "get" and "set" > accessors), and I'm sure there are some interactions I still haven't > accounted for. I'm not convinced the value justifies the complexity. > > So, while I'm putting this up for discussion, it may be that I will not > pursue landing it. I think a lot of the practical value of this accessors > proposal would be captured by support for read-only (and/or private-write) > properties. This has been discussed (and declined) in the past, but > probably should be revisited. > > Regards, > Nikita Another question: I skimmed through the PR and its tests, and I didn't see any tests around attributes. How do you envision attributes interacting with accessor-using properties? I suppose there's no change for implicit accessors, but what happens for explicit accessors? --Larry Garfield