[VOTE] Enumerations

php.internals

Larry Garfield

5 years ago
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

Dan Ackroyd

5 years ago
On Wed, 3 Feb 2021 at 17:29, Larry Garfield <larry@garfieldtech.com> wrote:
> > 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

Larry Garfield

5 years ago
On Wed, Feb 3, 2021, at 11:28 AM, Larry Garfield wrote:
> 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

Benjamin Morel

5 years ago
Congratulations 🎉 and thank you Larry and Ilija, this will be a great addition to PHP! — Benjamin On Wed, 17 Feb 2021 at 15:31, Larry Garfield <larry@garfieldtech.com> wrote:

Pierre

5 years ago
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

Rowan Collins

5 years ago
On 17/02/2021 14:30, Larry Garfield wrote:
> 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]

Chase Peeler

5 years ago
On Wed, Feb 17, 2021 at 10:09 AM Rowan Tommins <rowan.collins@gmail.com> wrote:
> On 17/02/2021 14:30, Larry Garfield wrote: > > 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] > > -- > PHP Internals - PHP Runtime Development Mailing List > 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

Ben Ramsey

5 years ago
> On Feb 17, 2021, at 09:26, Chase Peeler <chasepeeler@gmail.com> wrote: > > On Wed, Feb 17, 2021 at 10:09 AM Rowan Tommins <rowan.collins@gmail.com> > wrote: > >> On 17/02/2021 14:30, Larry Garfield wrote: >>> 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. >> >> > 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

Chase Peeler

5 years ago
On Wed, Feb 17, 2021 at 12:41 PM Ben Ramsey <ben@benramsey.com> wrote:
> > On Feb 17, 2021, at 09:26, Chase Peeler <chasepeeler@gmail.com> wrote: > > > > On Wed, Feb 17, 2021 at 10:09 AM Rowan Tommins <rowan.collins@gmail.com> > > wrote: > > > >> On 17/02/2021 14:30, Larry Garfield wrote: > >>> 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. > >> > >> > > 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 > >
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

Ben Ramsey

5 years ago
> On Feb 17, 2021, at 11:48, Chase Peeler <chasepeeler@gmail.com> wrote: > > 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

Rowan Collins

5 years ago
On 17/02/2021 17:51, Ben Ramsey wrote:
>> On Feb 17, 2021, at 11:48, Chase Peeler <chasepeeler@gmail.com> wrote: >> >> 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.
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]

Ben Ramsey

5 years ago
> On Feb 17, 2021, at 12:08, Rowan Tommins <rowan.collins@gmail.com> wrote: > > On 17/02/2021 17:51, Ben Ramsey wrote: >>> On Feb 17, 2021, at 11:48, Chase Peeler <chasepeeler@gmail.com> wrote: >>> >>> 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. > > > 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