Re: [PHP-DEV] Enum + property hook getter

2025-02-08 Thread Marc Bennewitz
Hi Tim, Unintentionally, I first replied to Tim only but it was meant to be send to the list. On 07.02.25 16:11, Tim Düsterhus wrote: Hi Am 2025-02-07 16:03, schrieb Marc Bennewitz: Is that something feasible and how complicated would that be to implement? Supporting this might cause conf

Re: [PHP-DEV] Enum + property hook getter

2025-02-07 Thread Tim Düsterhus
Hi Am 2025-02-07 16:03, schrieb Marc Bennewitz: Is that something feasible and how complicated would that be to implement? Supporting this might cause conflicts when full-blown tagged-unions are proposed, because those would actually support properties and semantics might need to be differen

[PHP-DEV] Enum + property hook getter

2025-02-07 Thread Marc Bennewitz
Hi all, Enums are not allowed to include object properties and with property hooks it's now possible to define get-only dynamic properties. I just come across the following example and wonder if this could be allowed in the future: enum Month:int {     case January = 1;     case February =