http_build_query() And Enumerations

no-email (Damien Seguy), Damien Seguy
Tue, 15 Apr 2025 00:00:00 +0000

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.