> Le 2 octobre 2013 à 07:59, Michael Wallner <m...@php.net> a écrit :
>
> 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).
>
Backwards compatibility matters, so we should keep $_GET and $_POST but add
these as better aliases for them.
 
While we're at it, can we remove the quirk that existed due to register_globals
where periods and such are replaced with underscores? Such that for
/test.php?php.pecl=3&php_pecl=4 we'd still only have $_GET['php_pecl'] === 4 but
there would also be $_QUERY['php.pecl'] === 3 and $_QUERY['php_pecl'] === 4, if
you get where I'm coming from.
> Further, I propose to remove the POST method restriction for handling
> request bodies and solely rely on the content type to trigger the
> parser(s). (*)
+1 to this, current behaviour is nonsensical.
> There are already parsers for application/x-www-form-urlencoded and
> multipart/form-data in the core.  One could think of providing an API
> to add content type handlers from extensions, ext/json may be an
> example, like it is hacked into pecl_http-v2.
+1 Handling JSON would be pretty neat. Maybe we could even support it by default
(after all, there is the json ext), so long as getting the unparsed request body
isn't impeded by that.
--
Andrea Faulds
http://ajf.me/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to