Re: Stop replacing dots with underscores in query, post and cookie parameters for PHP 8?

From: Date: Thu, 18 Jul 2019 07:08:05 +0000
Subject: Re: Stop replacing dots with underscores in query, post and cookie parameters for PHP 8?
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-106229@lists.php.net to get a copy of this message
Le mar. 16 juil. 2019 à 09:51, Nikita Popov <nikita.ppv@gmail.com> a écrit : > On Tue, Jul 16, 2019 at 3:40 AM Arnold Daniels < > arnold.adaniels.nl@gmail.com> > wrote: > > > Hi, > > > > PHP replaces dots with underscores for $_GET, $_POST and $_COOKIE. This > > behavior once made sense because of Register globals. The explanation in > > the manual also still implies that query and post parameters are > converted > > to variables (see > > > ˜îÏ > :¨°!½e¦ŽJhttps://php.net/manual/en/language.variables.external.php#language.variables.external.dot-in-names > ). > > Register globals has been removed since 5.4.0 and thus this behavior > serves > > little purpose. > > > > I think it would be good to remove the conversion in PHP 8, as it's a > > general cause of confusion and annoyance for anyone who comes across it.. > > > > Is there a good reason to keep this behavior in PHP 8? > > > > This has been discussed a few times already, and I think that everyone > agrees that this behavior should go, but not necessarily on the migration > path. There is an RFC here: > https://wiki.php.net/rfc/on_demand_name_mangling > I think that the latest version of that RFC, that basically proposes to > drop the behavior and tell people to use a polyfill is fine. > The RFC doesn't tell about parse_str(), while this is the userland variant of this. I think it could be useful to make parse_str accept a third argument starting with PHP 7.4! That would allow userland code to opt-in for the new behavior asap, and would provide the core implementation for ppl that want to keep the current behavior for PHP8. Makes sense? Nicolas

« previous php.internals (#106229) next »