Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100141 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65787 invoked from network); 1 Aug 2017 03:26:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Aug 2017 03:26:07 -0000 X-Host-Fingerprint: 95.148.131.182 unknown Received: from [95.148.131.182] ([95.148.131.182:15421] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/B3-07025-FC4FF795 for ; Mon, 31 Jul 2017 23:26:07 -0400 Message-ID: To: internals@lists.php.net References: <4F.AF.40376.40EBC795@pb1.pair.com> Date: Tue, 1 Aug 2017 04:26:04 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 95.148.131.182 Subject: Re: [PHP-DEV] json_encode() / json_decode() warnings From: ajf@ajf.me (Andrea Faulds) Jakub Zelenka wrote: > On Sat, Jul 29, 2017 at 7:10 PM, Niklas Keller wrote: > >> Andrea Faulds schrieb am Sa., 29. Juli 2017, 18:55: >> >>> Hi Craig, >>> >>> Craig Duncan wrote: >>>> On 29 July 2017 at 15:16, Andrea Faulds wrote: >>>> >>>>> Could we not simply make it a flag? e.g. >>>>> >>>>> $bar = json_encode($foo, JSON_THROW_EXCEPTIONS); >>>>> $baz = json_decode($bar, false, 512, JSON_THROW_EXCEPTIONS); >>>>> >>>>> That wouldn't break backwards-compatibility, but would still provide >> the >>>>> desired functionality. :) >>>> >>>> >>>> Hi Andrea, although that wouldn't break compatibility, it doesn't >> protect >>>> new developers from using them dangerously. >>>> That desired functionality is available in many userland libraries, I >>> don't >>>> think we gain much from adding it to core. >>>> My aim is to make the core functions easier/safer to use out of the >> box. >>> >>> That's true, but if we add it to core we can save people reimplementing >>> it themselves or adding an extra dependency, and perhaps more >>> pertinently, it could be the first step to making this the default >>> behaviour. >>> >> >> Thanks for that very good idea. >> >> @Sara: Can we please get that into 7.2? >> > > I agree that it might be a useful feature for some users but I don't see > any need to break a release rules for that (I mean adding new features in > beta stage). Also the PR needs to have a full agreement which is not the > case atm. (still some open questions) so I wouldn't definitely rush with > adding that to 7.2. This should go just to master if all parts are agreed > IMHO. That's of course up to RM and this is just my opinion. :) > There's no significant open questions, it's all bikeshedding over tiny details. -- Andrea Faulds https://ajf.me/