Re: HTTP supergloblas and request body/query (was: Parsing PUT data)
| From: | Adam Harvey | Date: | Wed, 02 Oct 2013 18:43:21 +0000 |
| Subject: | Re: HTTP supergloblas and request body/query (was: Parsing PUT data) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69466@lists.php.net to get a copy of this message | ||
> On 02.10.2013, at 10:59, Michael Wallner <mike@php.net> wrote:
>
>> Since ever people are confused by _GET and _POST superglobals,
>> because, despite their name, they do not (really) depend on the
>> request method. Therefor I propose to phase out $_GET and name it
>> $_QUERY and I propose to phase out $_POST and name it $_FORM (I'm not
>> 100% confident with the latter yet, though).
I'm not really sure people are confused, actually. There are plenty of
common gotchas that I see daily in ##php, but that isn't one of them.
I like how Alexey broke this down, so I'm going to steal it. :)
On 2 October 2013 00:17, Alexey Zakhlestin <indeyets@gmail.com> wrote:
> 1. _GET -> _QUERY, _POST -> _FORM
As I hinted at above, I'm -1 on this at first blush. I don't think
it's really that confusing in practice and $_GET and $_POST have a lot
of history (and muscle memory) behind them at this point.
> 2. ignore request-method, trigger body-processing solely on Content-type
Definite +1 here.
> 3. expose body-parsers via php-level API
+1, particularly if it's also available in userland as Alexey got
excited about. :)
Adam