Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68913 invoked from network); 29 Jul 2017 18:10:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2017 18:10:52 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.219 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.219 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.219] ([81.169.146.219:35617] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/C0-40376-AAFCC795 for ; Sat, 29 Jul 2017 14:10:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1501351847; l=3254; s=domk; d=kelunik.com; h=Content-Type:To:Subject:Date:From:In-Reply-To:References: MIME-Version; bh=tbq9H4g0oR9N6NrqqUcGfhOwU/ckM+ce7I2MPiInqSg=; b=vd8ibc2jPIx0WKrbh6Ghxrfh7Bw9L+cwJ3gQxI7CXQIMgS871Rto2H8q0kfOuFWFuL qYyq353SBaYuu46lv8yS0Bi0IkrCdJ6dT73VQBJnSLMyKbF1tptQJ1uXIzNghhRljCmv dqXWJ8FsuqSxZ1h5xdJVeprYcoTYYtAUEbmNI= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoNHBqT53Q== X-RZG-CLASS-ID: mo00 Received: by mail-oi0-f51.google.com with SMTP id x3so151552725oia.1 for ; Sat, 29 Jul 2017 11:10:47 -0700 (PDT) X-Gm-Message-State: AIVw111nFFkG0Qqvr2gbkhIYfg+ZbsYLe1CMgqKP7XcDFikLze2nQuS5 gD3/KzSVUBce3QVTpHAzHAZpX9ycrQ== X-Received: by 10.202.74.83 with SMTP id x80mr9885740oia.28.1501351846464; Sat, 29 Jul 2017 11:10:46 -0700 (PDT) MIME-Version: 1.0 References: <4F.AF.40376.40EBC795@pb1.pair.com> In-Reply-To: <4F.AF.40376.40EBC795@pb1.pair.com> Date: Sat, 29 Jul 2017 18:10:35 +0000 X-Gmail-Original-Message-ID: Message-ID: To: Andrea Faulds , PHP Internals , Sara Golemon Content-Type: multipart/alternative; boundary="001a1134e8ec7dd938055578b796" Subject: Re: [PHP-DEV] json_encode() / json_decode() warnings From: me@kelunik.com (Niklas Keller) --001a1134e8ec7dd938055578b796 Content-Type: text/plain; charset="UTF-8" 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? Regards, Niklas > --001a1134e8ec7dd938055578b796--