protobuf
protobuf copied to clipboard
Enums for Protobuf PHP?
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.
@haberman do you have any thoughts on this?
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.
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.
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.