Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78070 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99611 invoked from network); 14 Oct 2014 21:38:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 21:38:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.180 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.214.180 mail-ob0-f180.google.com Received: from [209.85.214.180] ([209.85.214.180:60766] helo=mail-ob0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/18-18603-6E79D345 for ; Tue, 14 Oct 2014 17:38:46 -0400 Received: by mail-ob0-f180.google.com with SMTP id va2so180769obc.39 for ; Tue, 14 Oct 2014 14:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=biAjHgflvy+wiJpn1J59vJGXZ/3kafsMpdWsM690a1U=; b=zLmoarJXn9uoiFvPjciyODpEb3m+tsucQJ8EC0xdmlRRzx1OHh65hM+EayO9hsEYiI U6Ax7AJYT+e61jp1qKGDfrgeietnRLpOkq+qoFd0VPY8Jr2kVqlFGSbYK37ieaD8AQMg jxq7cE4/ru8pa8u8dUvIRXE9e2JzYFHwHzOV+nMkfZPmWtBfwix6Jv5vkg3WnBQJ+pAQ yPhK778bH/74gFSm4+OsIIcsCY6/sBZdJNp8hGSWTrVsW+vtT1MXWm/mqA7RtoXklF+5 JhwEi7TjiBOax7uEJfKJgrhDwv46uKkSTtoIKkz5iI6apCvLr/IPwilimxAhxB1iCU01 9bMQ== MIME-Version: 1.0 X-Received: by 10.182.246.40 with SMTP id xt8mr4017399obc.59.1413322723284; Tue, 14 Oct 2014 14:38:43 -0700 (PDT) Received: by 10.202.169.201 with HTTP; Tue, 14 Oct 2014 14:38:43 -0700 (PDT) In-Reply-To: <543D85E6.2020507@lerdorf.com> References: <776669CE-9E8C-4069-9834-C7275CCA0EF4@ajf.me> <8CB055D4-F164-4DF3-B019-684BAE7E016E@ajf.me> <543D47C1.9050009@lerdorf.com> <543D4CE1.5000109@lerdorf.com> <543D6864.10508@gmail.com> <543D85E6.2020507@lerdorf.com> Date: Tue, 14 Oct 2014 14:38:43 -0700 Message-ID: To: Rasmus Lerdorf Cc: Rowan Collins , PHP internals list Content-Type: multipart/alternative; boundary=001a11c32246dfdd4c050568d6dd Subject: Re: [PHP-DEV] New globals for PUT and DELETE From: kris.craig@gmail.com (Kris Craig) --001a11c32246dfdd4c050568d6dd Content-Type: text/plain; charset=UTF-8 On Tue, Oct 14, 2014 at 1:21 PM, Rasmus Lerdorf wrote: > On 10/14/2014 11:16 AM, Rowan Collins wrote: > > On 14/10/2014 17:18, Rasmus Lerdorf wrote: > >> I think 20+ years of history has proven this to be a non-issue. Of all > >> the things that people get confused by in PHP, $_GET/$_POST are right > >> near the bottom of the list. > > > > The popularity of REST is what has changed this. Until people started > > writing RESTful APIs, only two HTTP request types were in common use. > > Nobody was confused about where PUT method data would end up, because > > nobody processed any PUT methods. > > > >> It makes no sense to me to make $_BODY an alias for $_POST. $_POST > >> implies the default body encoding that a broswer performs on a POST > >> request. Making an alias called $_BODY that doesn't contain the body of > >> a request unless it is "POST"-encoded would be super confusing. > > > > The encoding has no relationship with the request type, even in browsers > > - the default encoding of a POST form is actually the same encoding used > > to produce a URL form a GET form. > > Sure, but $_GET/$_POST do. They were not named to match HTTP primitives. > They were named to match form methods. As in form method="get" and > method="post". And here the default encoding the browsers use for these > two methods definitely matter. > > -Rasmus > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > I understand that that was the original intent. However, the use cases have expanded beyond simply handling HTML form submissions. People are writing REST APIs using PHP now, and having GET/POST but not PUT/DELETE has indeed led to confusion. I only posted this after doing a Google search and finding tons of results from people mistakenly asking why PHP doesn't handle PUT/DELETE requests or complaining how the lack of aliases for PUT/DELETE leads to inconsistency in the code. Personally, I like the idea of using more appropriately named aliases, particularly if they're roughly the same number of characters. However, we would need to allow at least several years for people to adopt the new globals before deprecating $_GET and $_POST. Ultimately, they will either need to be deprecated or the $_PUT and $_DELETE aliases will need to be added, otherwise the issue I raised would remain unresolved. --Kris --001a11c32246dfdd4c050568d6dd--