protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Enums for Protobuf PHP?

Open bshaffer opened this issue 1 year ago • 2 comments

PHP 8.1 brought us Enumerations, which are absolutely perfect for use in Protobuf. Specifically, backed Enumerations would bring us exactly what we want:

enum Status: int
{
    case STATUS_UNDEFINED = 0;
    case ACTIVE = 1;
    case INACTIVE = 2;
}

Now that this library supports a minimum of PHP 8.1, would the protobuf team entertain a change like this? We would want to put it behind an option, so as to prevent breaking changes.

bshaffer avatar Jan 24 '24 17:01 bshaffer

@haberman do you have any thoughts on this?

buchgr avatar Jan 25 '24 10:01 buchgr

Brent, we'd love to take advantage of the new PHP feature. We'd have to stage the change to allow for a migration, possibly using editions: https://protobuf.dev/editions/overview/

If you could write a proposal for this, we could review it and review a PR to implement it.

haberman avatar Feb 08 '24 00:02 haberman

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar May 17 '24 10:05 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Jun 01 '24 10:06 github-actions[bot]