Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106218 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16600 invoked from network); 16 Jul 2019 16:52:20 -0000 Received: from unknown (HELO tbjjbihbhebb.turbo-smtp.net) (199.187.174.11) by pb1.pair.com with SMTP; 16 Jul 2019 16:52:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.net; s=turbo-smtp; x=1563891225; h=DomainKey-Signature:Received: Received:MIME-Version:References:In-Reply-To:From:Date: Message-ID:Subject:To:Cc:Content-Type; bh=iUQvsKAK9FDbnnwHRsiYmW TkGklIK5RkwOg2Q//CNHE=; b=e2vjTN43MEJsZ/BEy8g8iUlUsyFA0SNwqESDHk TH00bdytHVFDEPtrdJ1xAG1vhNstDlrAuQkZ14CExVX+z76n/9xKtwV89OMrGEkJ MnEus9ie7EoVJSpEIoX3UcH7QxvOIIuOlusineBxe9CkogjPhAwptP1xn0XhvbZp DdqKY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=turbo-smtp; d=php.net; h=Received:Received:X-TurboSMTP-Tracking:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version:References:In-Reply-To:From:Date:X-Gmail-Original-Message-Id:Message-ID:Subject:To:Cc:Content-Type; b=Q+HCeI/VY1KiPSOAQfL2i8E5jhq7sGdwIDoy5AfTKSSoHttZtY12OnE192jGhV MaLoQhYmEWlO9z4kvxxTNAoI5P6zW31FnlCsUhpDc8C7jTT0LchkJJdJW7MYEUR5 gjEucyfkkwiy4GrNeevSr1UNebGahPE0GL4UHK6hvL38k=; Received: (qmail 21210 invoked from network); 16 Jul 2019 14:13:45 -0000 Received: X-TurboSMTP-Tracking: 5163605710 X-Gm-Message-State: APjAAAV59vCLNhXk4whAPu94dV8QpzpKQLTimp4lbk9aE4XZ+RpCEjQC edTxblqU7g/v6lfpXw9U37pahLoY5sgQntFiHU4= X-Google-Smtp-Source: APXvYqy47Kw4stucGD1WCqL0w2NV7I1BaYCx6cbNPvfNEKmhm8EMe8otvcvv9veoOR/R4P39wXAEVzftQSSGj1X7SIo= X-Received: by 2002:aed:306e:: with SMTP id 101mr22903778qte.102.1563286424597; Tue, 16 Jul 2019 07:13:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 16 Jul 2019 07:13:34 -0700 X-Gmail-Original-Message-Id: Message-ID: To: bishop@php.net Cc: Arnold Daniels , PHP internals Content-Type: multipart/alternative; boundary="0000000000000538b4058dccfc67" Subject: Re: [PHP-DEV] Stop replacing dots with underscores in query, post and cookie parameters for PHP 8? From: zeev@php.net (Zeev Suraski) --0000000000000538b4058dccfc67 Content-Type: text/plain; charset="UTF-8" On Tue, Jul 16, 2019 at 5:34 AM Bishop Bettini wrote: > On Tue, Jul 16, 2019 at 3:51 AM Nikita Popov wrote: > > > 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 > > > > > > 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? > > > > > > > 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. > > > > I've readied the proposal for formal discussion. As proposed: > > - PHP 8.0 will no longer mangle variable names in any super-global. > - The changelog will recommend auditing super-global access for mangled > names, and replacing with the actual variable name. > - No INI settings will engage the behavior. > - No warnings or notices will be emitted. > - A polyfill will be made available to emulate that original behavior. > - Applications requiring name mangling shall invoke the polyfill during > bootstrap phase. > > https://wiki.php.net/rfc/on_demand_name_mangling I think it looks good and well thought-through. The only thing I'd add is having the userland polyfill function implementation available/referenced in the Upgrade notes, so that folks can get it without Composer (in addition of having it available in Composer). I suspect the ones who'd actually won't to use it are quite likely to not be Composer users. Zeev --0000000000000538b4058dccfc67--