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

From: Date: Tue, 16 Jul 2019 06:45:02 +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-106215@lists.php.net to get a copy of this message
On Tue, Jul 16, 2019 at 4:39 AM Sara Golemon <pollita@php.net> wrote: > > On Mon, Jul 15, 2019 at 8:39 PM Arnold Daniels <arnold.adaniels.nl@gmail.com> > wrote: > > 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 > > https://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? > > > IMO, we can safely kill this. If anyone needs this behavior preserved, it > can be mimicked with half a dozen lines of PHP, or heck we can include a > function to call. I will, however, be very surprised if anyone misses this > by now. > > -Sara Indeed, it seems that people are rather strugling to work around the current behavior (and have been for years)... Some examples: - https://bugs.php.net/bug.php?id=40000 - https://stackoverflow.com/questions/68651/get-php-to-stop-replacing-characters-in-get-or-post-arrays - https://github.com/symfony/symfony/issues/9009 - https://github.com/api-platform/core/issues/509 - https://github.com/api-platform/core/blob/v2.4.5/src/Util/RequestParser.php -- Guilliam Xavier

« previous php.internals (#106215) next »