Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9482 invoked from network); 20 Oct 2014 08:21:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2014 08:21:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:32926] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/20-06323-FF5C4445 for ; Mon, 20 Oct 2014 04:21:19 -0400 Received: by mail-wi0-f170.google.com with SMTP id hi2so7726392wib.1 for ; Mon, 20 Oct 2014 01:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to :message-id; bh=0XE+4MA0b9oBQZg0K3NrJobwnkc761zinwSS5XF5cf8=; b=hFOBoBc7Iqwf2rmChNonJysfkJZyv09NZfOKL40U5skCRwCaBkmKzvGALn+txCcxoT S60RbheQcAlLVWLR1kVOX4e1UlmLxF6ml6WxXvUncO6YWCASU64pDFOUzc2Iqrw4WmjT 054NAJSZ1aEDp21EQ9pZrD5u3og8gdRwQt294SWM/z3ateT5flX2Y8nGr4o6RUsLQbkC 8/Y3JEjtxZJhYq/HnirJ4z6QPSSlbkKEIOC2Ai5gFVP+6ltJmQNKOl2R3N1yKH59nsYa zlM0opBEl/+HxRyOkz2lbHy78Sr8EAih8Y8HlcyXzB+A6AgTByprr6IQhfdhbAty++/H P/jg== X-Received: by 10.180.188.229 with SMTP id gd5mr18595711wic.25.1413793276285; Mon, 20 Oct 2014 01:21:16 -0700 (PDT) Received: from [100.105.89.0] ([213.205.252.144]) by mx.google.com with ESMTPSA id t16sm8089893wjr.44.2014.10.20.01.21.15 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Oct 2014 01:21:15 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Mon, 20 Oct 2014 09:04:25 +0100 To: "internals@lists.php.net" Message-ID: Subject: Re: [PHP-DEV] always_populate_raw_post_data E_DEPRECATED thrown by default From: rowan.collins@gmail.com (Rowan Collins) On 20 October 2014 05:48:04 GMT+01:00, Davey Shafik wrote: >Hey folks, > >A thread on reddit (here: >https://www.reddit.com/r/PHP/comments/2jpzzj/php_56_throws_e_deprecated_by_default_for_no/) >noted that in 5.6 there is an E_DEPRECATED thrown if >"always_populate_raw_post_data" is set to anything but -1 > >There is an issue in that the default value is 0 (see: >http://lxr.php.net/xref/PHP_5_6/main/main.c#641 I believe). > >This means that the E_DEPRECATED is always thrown in the default case, >and >if you've never cared about this setting, and don't use it, you may now >be >seeing an unnecessary warning. > >I'd like to set the default to -1. > >The php.ini-* files state: > >; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default >behavior >is >; to disable this feature and it will be removed in a future version. >; If post reading is disabled through enable_post_data_reading, >; $HTTP_RAW_POST_DATA is *NOT* populated. >; http://php.net/always-populate-raw-post-data >;always_populate_raw_post_data = -1 > >Being as the current default is not to populate it, and (currently) -1 >has >the same affect and also suppresses the E_DEPRECATED, I don't think >this >change is a BC issue. > >The other option is to only throw the E_DEPRECATED when it's set to 1 >(as >you are actively trying to use the feature). > >Thoughts? > >Thanks, > >- Davey I remember there being a fair amount of back and forth about this on the list when the change was made. The problem is that people who have it set to 0/false - either explicitly, or because they've never touched the default value - may still be relying on $HTTP_RAW_POST_DATA, since the default is basically for it to be populated whenever $_POST isn't. Until 5.6, there were a handful of situations where php://input didn't work as desired, but with these resolved, the idea is to encourage everyone to avoid $HTTP_RAW_POST_DATA completely, and actively set their configuration to never populate it. So, messy though it is to have the default be deprecated, that is actually a deliberate intention. Distributors can of course include php.ini files which set this to -1 for new users. Regards, -- Rowan Collins [IMSoP]