Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78156 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13487 invoked from network); 20 Oct 2014 09:32:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2014 09:32:11 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.181 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.181 mail-qc0-f181.google.com Received: from [209.85.216.181] ([209.85.216.181:40650] helo=mail-qc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/B0-06323-996D4445 for ; Mon, 20 Oct 2014 05:32:10 -0400 Received: by mail-qc0-f181.google.com with SMTP id r5so3265503qcx.26 for ; Mon, 20 Oct 2014 02:32:07 -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=C25m6nxjHMD2ixWlfkNH2RvQtmsZ51aYokpC3Ym6+/g=; b=066b0eim+RkB0KhJrPAjsdVWfsW0UDpHUogrwAaW7lLmOzMypweYu+JK7B4xUJHnKZ 2y1iBAuaSBazwNRPGFEAvy8DwTkEKxmUguQ9XoFh2itKE+Z1mHxmjfpKVHNOWH+nYm8t ZCRMNVBIgzVCmZaFgo1bhOtWeto90ahxNg6ugWBqFBxFXZtgkdtPFoTv1ZLlHmT5M5cd ESbCi6Xmp5oUOKWGJMUeVz7wSCZIxHSIaFiIKybz+FS3sSTr3s5/xOFJKhKWRPejPETV PK3Pxr3d2Wu/w6P94pZVNGH1mqyCfKgPs6U300dfyAGPuYyEF18JH18xUtx9nHR5S4ND IcCw== MIME-Version: 1.0 X-Received: by 10.229.173.193 with SMTP id q1mr34042147qcz.10.1413797527228; Mon, 20 Oct 2014 02:32:07 -0700 (PDT) Received: by 10.140.107.130 with HTTP; Mon, 20 Oct 2014 02:32:07 -0700 (PDT) Received: by 10.140.107.130 with HTTP; Mon, 20 Oct 2014 02:32:07 -0700 (PDT) In-Reply-To: References: Date: Mon, 20 Oct 2014 11:32:07 +0200 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c294d46517e40505d763e4 Subject: Re: [PHP-DEV] always_populate_raw_post_data E_DEPRECATED thrown by default From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c294d46517e40505d763e4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2014.10.20. 10:21 ezt =C3=ADrta ("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 =3D -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] > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Yep, the thing is, that $HTTP_RAW_POST_DATA can be even populated when always_populate_raw_post_data is set to 0, so we had to introduce the -1 value to not break BC but allow to opt-in to the never populate $HTTP_RAW_POST_DATA which can save a huge amount of resources. We also wanted a deprecated so people are aware that $HTTP_RAW_POST_DATA is going away and it was not feassible to add the warning when acessing $HTTP_RAW_POST_DATA as it is a non-super global so it would have required a check for every access to global variables. I'm planning to update the upgrading docs with some notice and rationale as somebody already reported that the deprecated notice broke his app (he is/was running a soap service with display_errors On ...) --001a11c294d46517e40505d763e4--