Re: New globals for PUT and DELETE
| From: | Mike Dugan | Date: | Tue, 14 Oct 2014 14:08:09 +0000 |
| Subject: | Re: New globals for PUT and DELETE | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78007@lists.php.net to get a copy of this message | ||
On October 14, 2014 at 10:04:00 AM, Andrea Faulds (ajf@ajf.me) wrote:
On 14 Oct 2014, at 14:53, Chris Wright <cw@daverandom.com> wrote:
> Also, I think Mike got the naming right there as well, $form is the
> accurate description of what it is.
You’re right, actually. multipart and url-encoded are usually produced by forms, and other types
of request bodies (JSON, plaintext) don’t end up in $_POST.
So $_QUERY and $_FORM, then. That sounds about right.
I suppose $_QUERY is *technically* incorrect for similar reasons, in that if you have a plain
parameter-less query string (e.g. http://example..com/foobar.php?query%20string)
it won’t end up in $_GET… but I don’t think that’s widely used, and there are only two
formats that come after the question mark. If you really need the raw string, it’s in $_SERVER
anyway. So that’s not really a problem.
--
Andrea Faulds
http://ajf.me/
Did I just name a global variable? W00t!
Anyhow, yeah neither one is technically 100% correct, but like Andrea said, the majority of usage
will be from forms and query strings with parameters. At any rate, it’s makes more sense
semantically in the context of what the var actually contains than $_GET and $_POST ever will.
—
Mike Dugan
mike@mjdugan.com