-
Notifications
You must be signed in to change notification settings - Fork 7.9k
BackedEnum support for http_build_query #15650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree that the default behavior of enum Foo: int {
case Bar = 1;
}
var_dump((array) Foo::Bar);
In general, enums are not their backing values, and conversion is explicit. This was a deliberate design decision of enums. I don't see much harm in handling them here though, although that poses the question why here and not in other places? Then again, we do have some special handling already, like @Crell Thoughts? |
I'm of two minds here, I suppose.
Having the enum be a value of an array passed to |
I created an implementation here: #15704. Doesn't seem harmful. |
Description
Currently,
http_build_query
converts BackedEnums into an object, which is not very useful.I would like the result to be aligned with
json_encode
which returns the backed value.The text was updated successfully, but these errors were encountered: