On 06.08.2021 at 15:20, Rowan Tommins wrote: > 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.
Right. *If* we want to change this name mangling, we should change it everywhere, and that certainly needs an own RFC and ideally some kind of deprecation/change notice. -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php