Re: RFC [Concept] - Interface Properties

From: Date: Sat, 27 May 2023 17:24:23 +0000
Subject: Re: RFC [Concept] - Interface Properties
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-120405@lists.php.net to get a copy of this message
On Sat, May 27, 2023, at 1:39 AM, Nick Humphries wrote: > Hello internals, > > Based on a few discussions I've had recently, my team and I couldn't > think of any reason why we shouldn't have properties on interfaces as > it is common for these to be specified in doc blocks currently. > Timing-wise, this lines up well with dynamic properties being > depreciated. > > I've thrown together a very quick POC, there are many tests and > examples of how this could look. > > > https://github.com/php/php-src/compare/master...Humni:php-src:feature/rfc-interface-properties > > Some of the key architectural decisions: > - interfaces can implement the same property (exact type match only) > - interface properties must be public > - interface properties can't be static > - interface properties can be readonly > > Open to feedback from everyone on this - keen to get the ball rolling > quickly on it! Interface properties are already included in the Property Hooks RFC, which should be going to a vote soon-ish. We hope it passes, of course. :-) https://wiki.php.net/rfc/property-hooks --Larry Garfield

« previous php.internals (#120405) next »