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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to