Re: [RFC] Properties in interfaces
| From: | Larry Garfield | Date: | Thu, 30 Mar 2023 12:49:42 +0000 |
| Subject: | Re: [RFC] Properties in interfaces | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119788@lists.php.net to get a copy of this message | ||
On Wed, Mar 29, 2023, at 7:53 PM, Zoltán Fekete wrote:
> Hi,
>
> [Proposal]
> Allow interfaces to define properties. The implementing class must
> have the same properties with the same name/type.
>
> As the goal of the interfaces is to define the public "surface" of
> the implementing class, I think that the public properties are also
> part of that.
This is a part of the "Property Hooks" RFC that Ilija and are working on.. It's not
*quite* done yet, but it's mostly there. The draft is available here: https://wiki.php.net/rfc/property-hooks
The main thing we still have to sort out is serialization handling. Everything else is pretty well
stable, including defining properties asymmetrically in interfaces.
We hope to have it finalized and ready for discussion within the next month-or-less. (Fingers
crossed.)
--Larry Garfield