Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108685 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33113 invoked from network); 19 Feb 2020 20:35:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Feb 2020 20:35:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 304E3180533 for ; Wed, 19 Feb 2020 10:51:05 -0800 (PST) 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,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 out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 ; Wed, 19 Feb 2020 10:51:04 -0800 (PST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E46BE222E6 for ; Wed, 19 Feb 2020 13:51:03 -0500 (EST) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Wed, 19 Feb 2020 13:51:03 -0500 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=/y1NEi5nWWmdkHmeR4Flx9gPDJtGHqs/Kwl4hK/6Z V4=; b=0hPoMhJPmmqHJ/8JUtM32b1bPDd4srfHas6AmCCHkk9Ki/jdVBqkFWqqg cCdljyt8DkD5ERT50blHx/jms11FHpaWvdb+Fv9JawbtIk5JRo2eGVO9bhoOOj+X sIRH2KaD3v/0UoEIPQ9nsK3h9pg6jNXtUWe4+mU0/BZWuJBqW8GVR7k/z4c7acDM Oi40jY34Gw0zO72Mrjhq4/4f22UhT//vny5drv2lsxpv+e9fodpchC9e0QYsFapy wOEeMx1HEg7Nou729AGtiopjHxNJ1Zp36PCMZZO/q5NG3R4mhl50DJCY42SuAK33 O9zL3Z5Wemj68RNiSfwblKfcrrqQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkedtgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrd gtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5213814200A2; Wed, 19 Feb 2020 13:51:03 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-802-g7a41c81-fmstable-20200203v1 Mime-Version: 1.0 Message-ID: <65c78b5a-55a6-4f1f-b881-f1401aa7dbb1@www.fastmail.com> In-Reply-To: References: Date: Wed, 19 Feb 2020 12:50:42 -0600 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 Wed, Feb 19, 2020, at 11:05 AM, M=C3=A1t=C3=A9 Kocsis wrote: > Hi Internals, >=20 > I'd like to move my RFC forward to the discussion phase: > https://wiki.php.net/rfc/write_once_properties >=20 > In short, I propose to add support for a new property modifier that wo= uld > allow properties to be initialized, but not modified afterwards. >=20 > Cheers, > M=C3=A1t=C3=A9 Kocsis As envisoned, does this allow for a property to be set to a dynamic valu= e? My concern is that while a public locked/writeonce property is great= for access, it doesn't do anything to enable lazy setting on first acce= ss. In fact the only way to do that would be to make it private and wra= p access in a method, which would look exactly like that does now but wi= th an extra keyword that doesn't actually offer much. You could set the value in advance in the constructor, but then it's not= lazy, just locked. Is there a way it could support lazy-on-first-use then locked? --Larry Garfield