http_build_query() And Enumerations

../_images/http_build_query_enum.png

When using a backed enum with http_build_query(), the PHP native function uses the value of the case, and not the case itself. This is very convenient to output a compatible value, instead of an internal object. This is valid since PHP 8.4.

See Also

PHP Features