Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127616 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id BE4F51A00BC for ; Fri, 6 Jun 2025 01:21:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749172796; bh=FDIo638B0r141wy2lltWE2Ttc8Z4KvjebWN1WsnLlR4=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=UlrlXFpkb0fsYIZvNRK7UTarWWjnjAnb/t4u46Fxvc+769aMiSFlFUDgKQoLybRHt SjYrMlW/jVB68QlPPb72FpQe6OJ9Nw4/MP+huK0QNqP51hsWRpamLUYksWKkQKT0ti 5PgRT0hgfaGuvXgPjofHMBM+L+pCWWBsKotoWDT6WgimwifC0VwFF5VzuN2JSsUsEO ZUzlB7TwmN27jTaB6lipkn26jknnFHrqKaoPpCBwE25QV58u9/n1NdquEkrMAuQoGT n5HQ8bvxJY5Z9Z0hGa2X6OXb3UMj7cTzm5XJYYbT4EzqCSPgOOtzfgyIRTKxQG3Sst gQri5Rye6EeLQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C320F180047 for ; Fri, 6 Jun 2025 01:19:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: *** X-Spam-Status: No, score=3.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from avril.gn2.hosting (avril.gn2.hosting [84.19.162.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 6 Jun 2025 01:19:53 +0000 (UTC) Received: from avril.gn2.hosting (localhost [127.0.0.1]) by avril.gn2.hosting (Postfix) with ESMTP id 3FCBF1C409DC; Fri, 6 Jun 2025 03:21:55 +0200 (CEST) Received: from smtpclient.apple (unknown [113.210.105.166]) by avril.gn2.hosting (Postfix) with ESMTPSA id 95DF61C403B9; Fri, 6 Jun 2025 03:21:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nicksdot.dev; s=default; t=1749172915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eZhpVOKUv6k7xtwnRf00Pw/C3i6Eel5WX4Op2dDse98=; b=xZCZbHz5vpG4sXm3xXP1eLbB78LClZy/0QBWEmstlKPU+SVr95qfUmUTA8i7dDwpjq4vda 6ipSd/8XOH/iEfeG1t4aqLEQz4BtJNX44ppK7IgL7ZzZ/5v+EtlnVw8YRGwVjoKsgJIg8Y SROznZaKHmuDe5EQ8RjKi13SR0G82Kv4wqKw994AB5Q7e6tQ4yGj3AgYAUJSNUnh9VdZfi AVGjavrxZ7vwt1tWyslXZzF+X2Fe5PAoZl0DYgTMQCXBJWaHaQPbJaEyzrI4Bg1z+mbLmC KHAQ4qmfyx9slFbSvmJhha4xgdvkn5YELgt3e2IjRwSvuwEh5ksVvQ6KEXkIMw== Authentication-Results: avril.gn2.hosting; auth=pass smtp.auth=php@nicksdot.dev smtp.mailfrom=php@nicksdot.dev Message-ID: <670D93DC-73DF-4DEB-B0CA-67CB742DA23C@nicksdot.dev> Content-Type: multipart/alternative; boundary="Apple-Mail=_C7E2409B-2DED-4252-B9DE-29A311824F08" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: [PHP-DEV] Allow hooks in `readonly` promoted properties Date: Fri, 6 Jun 2025 09:21:37 +0800 In-Reply-To: <6b12585d-199f-4dc6-a557-5e68f59841b7@app.fastmail.com> Cc: php internals To: Larry Garfield References: <3FBC491A-FE60-4583-A3A2-0A58EC384C88@nicksdot.dev> <6b12585d-199f-4dc6-a557-5e68f59841b7@app.fastmail.com> X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; BAYES_HAM(-3.00)[100.00%]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; NEURAL_HAM(-0.00)[-0.990]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[nicksdot.dev:s=default]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:9534, ipnet:113.210.105.0/24, country:MY]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_ALL(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~] From: php@nicksdot.dev (Nick) --Apple-Mail=_C7E2409B-2DED-4252-B9DE-29A311824F08 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey Larry, > On 6. Jun 2025, at 01:06, Larry Garfield = wrote: >> Would this be expected to work? Can interface properties be declared = `readonly`? >> interface Cleaned >> { >> public readonly string $clean { get; } // has readonly >> } >=20 > Interface properties cannot be declared readonly today: >=20 > https://3v4l.org/cXgR0 >=20 > Which I think is correct behavior. Noted, thanks. > Make sure to include a test based on the "lazy product" example from = the RFC text. That's the main sort of use case I'd expect we'd want to = enable. :-) Added readonly_lazy.phpt =E2=80=94 Cheers, Nick= --Apple-Mail=_C7E2409B-2DED-4252-B9DE-29A311824F08 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hey Larry,

On 6. Jun 2025, at 01:06, Larry Garfield = <larry@garfieldtech.com> wrote:
Would this be expected to work? Can interface properties = be declared `readonly`?
interface = Cleaned
{
   public readonly string $clean { get; } = // has readonly
}

Interface properties cannot be = declared readonly today:

https://3v4l.org/cXgR0

Which = I think is correct behavior.

Noted, = thanks.

Make sure to include a = test based on the "lazy product" example from the RFC text.  That's = the main sort of use case I'd expect we'd want to enable. = :-)

Added readonly_lazy.phpt

=E2=80=94

Cheers,
Nick<= /div>= --Apple-Mail=_C7E2409B-2DED-4252-B9DE-29A311824F08--