On 06/08/2021 12:12, Kamil Tekiela wrote:
> Perhaps, instead of adjusting this behaviour only for the new function, we
> could remove this behaviour as a whole, given that it is a remainder of the
> long-forgotten register globals? I don't see any use for it anymore
Changing behaviour like this is tricky, because even if it's not that
useful, it is consistent, so code to process a query string of
"?foo.bar=42" will be looking at $_GET['foo_bar'] not $_GET['foo.bar'].
If we "fix" the name mangling, that code will break, and not necessarily
in a very obvious way.
Note that there are other parts of the request which get mangled in
similar ways, such as when HTTP headers are translated into CGI
environment variables. The solution in that case is to ignore the CGI
vars and use a function like getallheaders(), so having a non-mangling
http_parse_query() doesn't feel out of place.
Having the function mirror http_build_query() as closely as possible
seems like a good idea, e.g. http_parse_query('foo_0=a;foo_1=b', 'foo_',
';') should return [0=>'a', 1=>'b'].
Regards,
--
Rowan Tommins
[IMSoP]