Re: Allow hooks in `readonly` promoted properties

From: Date: Fri, 06 Jun 2025 01:21:37 +0000
Subject: Re: Allow hooks in `readonly` promoted properties
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-127616@lists.php.net to get a copy of this message
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 — Cheers, Nick

« previous php.internals (#127616) next »