Re: [RFC]: Allow static properties in enums

From: Date: Sun, 30 May 2021 14:31:00 +0000
Subject: Re: [RFC]: Allow static properties in enums
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-114668@lists.php.net to get a copy of this message
Hi internals,

> I've created a new RFC https://wiki.php.net/rfc/enum_allow_static_properties
> 
> Although enums are immutable objects, it is often useful to have functions or methods that
> operate on enum instances.
> In many cases, it would make sense to declare that functionality as static methods on the enum
> itself (which is already permitted).
> In cases where static methods require shared state, it would be useful to allow storing those
> shared state in static properties.
> To ensure immutability of enum instances, it's only necessary to forbid instance
> properties, but all properties were forbidden in the initial functionality > included with the
> enums RFC.
> 
> This RFC proposes allowing static properties in enums, while continuing to forbid instance
> properties.

I plan to start voting on https://wiki.php.net/rfc/enum_allow_static_properties
on June 1, 2021
 
Regards,
Tyson


Thread (6 messages)

« previous php.internals (#114668) next »