# [VOTE] Enumerations

- Thread: https://externals.io/message/113067
- Original archive: https://news-web.php.net/php.internals/113067
- Started by Larry Garfield on 2021-02-03T17:28:46+00:00
- Messages: 12
- RFC: Enumerations (Implemented (PHP 8.1)) — https://externals.io/rfc/enumerations.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #113067 — Larry Garfield — 2021-02-03T17:28:46+00:00

URL: https://externals.io/message/113067#113067

The vote on the Enumerations RFC is hereby opened.  It will run until 17 February 2021.

https://wiki.php.net/rfc/enumerations

Vote now, or forever hold your memory allocations.

-- 
  Larry Garfield
  larry@garfieldtech.com

---

## #113094 — Dan Ackroyd — 2021-02-05T21:48:02+00:00

URL: https://externals.io/message/113067#113094 · In reply to: #113067

>
> The vote on the Enumerations RFC is hereby opened.  It will run until 17 February 2021.

The no vote for this is slightly higher than I was expecting. I
understand that some people think enums should be 'just consts' and
some people might not like using objects for the implementation.

Other than those two, does anyone want to mention any other big
downsides that weren't raised during the conversation?

cheers
Dan
Ack

---

## #113189 — Larry Garfield — 2021-02-17T14:30:39+00:00

URL: https://externals.io/message/113067#113189 · In reply to: #113067

> The vote on the Enumerations RFC is hereby opened.  It will run until 
> 17 February 2021.
> 
> https://wiki.php.net/rfc/enumerations
> 
> Vote now, or forever hold your memory allocations.


The Enum vote has now closed.  Final results:

For: 44
Against: 7
Approval rate: 86%

The Enum RFC has been approved.  Ilija is still fixing up some bugs and edge cases in the code itself but it should be merged soon.

Thank you to everyone for your feedback, support, and votes over the past few weeks!  I would enumerate you all individually, but there's a lot of you and it would take up a lot of memory... :-)

--Larry Garfield

---

## #113190 — Benjamin Morel — 2021-02-17T14:32:48+00:00

URL: https://externals.io/message/113067#113190 · In reply to: #113189

Congratulations 🎉 and thank you Larry and Ilija, this will be a great
addition to PHP!

— Benjamin



> 
> > […]
>
>
> The Enum vote has now closed.  Final results:
>
> For: 44
> Against: 7
> Approval rate: 86%
>
> The Enum RFC has been approved.  Ilija is still fixing up some bugs and
> edge cases in the code itself but it should be merged soon.
>
> Thank you to everyone for your feedback, support, and votes over the past
> few weeks!  I would enumerate you all individually, but there's a lot of
> you and it would take up a lot of memory... :-)
>
> --Larry Garfield
>
> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php

---

## #113191 — Pierre — 2021-02-17T14:48:27+00:00

URL: https://externals.io/message/113067#113191 · In reply to: #113189

Le 17/02/2021 à 15:30, Larry Garfield a écrit :
> The Enum vote has now closed.  Final results:
>
> For: 44
> Against: 7
> Approval rate: 86%
>
> The Enum RFC has been approved.  Ilija is still fixing up some bugs and edge cases in the code itself but it should be merged soon.
>
> Thank you to everyone for your feedback, support, and votes over the past few weeks!  I would enumerate you all individually, but there's a lot of you and it would take up a lot of memory... :-)
>
> --Larry Garfield

That's great ! Thank you very much for all this work !

Regards,

--

Pierre

---

## #113192 — Rowan Tommins — 2021-02-17T15:09:51+00:00

URL: https://externals.io/message/113067#113192 · In reply to: #113189

> The Enum RFC has been approved.


Thank you and Ilija so much for putting in the effort to make such a 
carefully thought-through proposal, and I'm really looking forward to 
being able to use it.

I realise not everyone agrees with the approach, but am hopeful that it 
can be expanded on in future proposals to add a lot of power to the 
language.

Regards,

-- 
Rowan Tommins
[IMSoP]

---

## #113193 — Chase Peeler — 2021-02-17T15:26:32+00:00

URL: https://externals.io/message/113067#113193 · In reply to: #113192

On Wed, Feb 17, 2021 at 10:09 AM Rowan Tommins <rowan.collins@gmail.com>
wrote:

> 
> > […]
>
>
> Thank you and Ilija so much for putting in the effort to make such a
> carefully thought-through proposal, and I'm really looking forward to
> being able to use it.
>
> I realise not everyone agrees with the approach, but am hopeful that it
> can be expanded on in future proposals to add a lot of power to the
> language.
>
> Regards,
>
> --
> Rowan Tommins
> [IMSoP]
>
> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>
Glad to see this passed. I definitely would have voted for it if I had a
vote. The only thing I wish had been included was the ability to use them
as array keys, but definitely don't think the lack of that would be a
reason to vote against it - especially since the possibility is still open
in the future and adding it wouldn't cause any BC issues.

-- 
Chase Peeler
chasepeeler@gmail.com

---

## #113194 — Ben Ramsey — 2021-02-17T17:41:25+00:00

URL: https://externals.io/message/113067#113194 · In reply to: #113193

> 
> 
> On Wed, Feb 17, 2021 at 10:09 AM Rowan Tommins <rowan.collins@gmail.com>
> wrote:
> 
> > […]
> Glad to see this passed. I definitely would have voted for it if I had a
> vote. The only thing I wish had been included was the ability to use them
> as array keys, but definitely don't think the lack of that would be a
> reason to vote against it - especially since the possibility is still open
> in the future and adding it wouldn't cause any BC issues.


There’s an RFC for that. ;-)

https://wiki.php.net/rfc/object_keys_in_arrays

Cheers,
Ben

---

## #113195 — Chase Peeler — 2021-02-17T17:48:38+00:00

URL: https://externals.io/message/113067#113195 · In reply to: #113194

> > […]
> open
> > […]
>
>
> There’s an RFC for that. ;-)
>
> https://wiki.php.net/rfc/object_keys_in_arrays
>
> Cheers,
> Ben
>
>
If that were to not pass, though, it seems supporting enum cases as keys
would be worth exploring. Fully support allowing all objects as keys though.

-- 
Chase Peeler
chasepeeler@gmail.com

---

## #113196 — Ben Ramsey — 2021-02-17T17:51:51+00:00

URL: https://externals.io/message/113067#113196 · In reply to: #113195

> 
> 
> If that were to not pass, though, it seems supporting enum cases as keys would be worth exploring. Fully support allowing all objects as keys though.


Others, please correct me if I’m wrong, but I believe each enum case is already an object.

Cheers,
Ben

---

## #113197 — Rowan Tommins — 2021-02-17T18:08:07+00:00

URL: https://externals.io/message/113067#113197 · In reply to: #113196

> > […]
>
> Others, please correct me if I’m wrong, but I believe each enum case is already an object.


I think what Chase meant was that if we don't want to allow *all* 
objects as keys, we could allow *a specific subset*, namely Enum cases.

The implementation would be similar, but deliberately limiting the scope 
might avoid some undesirable edge cases and side effects.


Regards,

-- 
Rowan Tommins
[IMSoP]

---

## #113198 — Ben Ramsey — 2021-02-17T18:10:53+00:00

URL: https://externals.io/message/113067#113198 · In reply to: #113197

> 
> 
> 
> > […]
> 
> 
> I think what Chase meant was that if we don't want to allow *all* objects as keys, we could allow *a specific subset*, namely Enum cases.
> 
> The implementation would be similar, but deliberately limiting the scope might avoid some undesirable edge cases and side effects.


Sorry. When I read “were to not pass,” my brain missed the “not” part. :-)

Cheers,
Ben
