Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100106 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57280 invoked from network); 29 Jul 2017 16:08:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2017 16:08:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@duncanc.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@duncanc.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain duncanc.co.uk from 209.85.192.173 cause and error) X-PHP-List-Original-Sender: php@duncanc.co.uk X-Host-Fingerprint: 209.85.192.173 mail-pf0-f173.google.com Received: from [209.85.192.173] ([209.85.192.173:33269] helo=mail-pf0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/0F-40376-F03BC795 for ; Sat, 29 Jul 2017 12:08:48 -0400 Received: by mail-pf0-f173.google.com with SMTP id d67so38268962pfc.0 for ; Sat, 29 Jul 2017 09:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=duncanc-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EfLYvhLBOVF4WqK5VVlbjxaBBHqkQQQk+0MMtEiuvq0=; b=FDQ69IWO5CSldkyWtLasgwXRVA+gZ0O0Qd1ZnBaYDN1bB/BE1ka4MQ2bsEdap1E0bj rezJWxGRaDMeGq5qWkbEX6X/ww+gJThvaR9534zEBZot90LnrP+/BTXMw+IM5AvfvWKx f/Qky7uDwE50/yMLYFnWZDENujq84Q8dBLZfT1KzYtzvcMfD3NixZvFZXMLpIF7rl413 vtyWYcNmGFrCnj8r13lfdcU9IQDIorB3D1IxYNF8bXp/v9nBAovwABIoND3onvhMVsu3 4NaDVMLAnLboWxXpB+QvaVx06bke9YZK1G1MFXhRZCL+kEuPYmQjKBOfFYyYSfBy9Abb tgNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EfLYvhLBOVF4WqK5VVlbjxaBBHqkQQQk+0MMtEiuvq0=; b=DP2bWKi/QCUNr9OFoxubHUp98OBXMPNQfkOg0q1Nk96mm895zz/OqJe0JaHrfmmRqK OOaaBcRdogjr0atRpG55eStttjxDTuxkhJ3epZt3nf9fas21mn0S/laq6YuhQQUFblpz UfzIMsYXsV2aCirFJza5exvc6cJqep5auJFAiAvx3re8ZLhpvunLG8TIlWEXmvvU+lnJ fP8JE2LWDK/56HEthA1GxqnBKlg7W8Ag/3ROd3RkxnhFR4HchoTLuHnNV0NwdUmMnXsv Xgq8TUKuuhR1N7NSxjMJ81MxWX2MyNP+FqT6zrIw4q79L5r3OhmMyfr+8S62vusq+22U 7uPg== X-Gm-Message-State: AIVw113WQyD+d3vysShTR3vrE/5YS0wfJn+pzaQQzoyamEg5VVIKiNUz okS5ZEQ/mq08zcq8pyk= X-Received: by 10.84.231.203 with SMTP id g11mr11639349pln.241.1501344523415; Sat, 29 Jul 2017 09:08:43 -0700 (PDT) Received: from mail-pg0-f47.google.com (mail-pg0-f47.google.com. [74.125.83.47]) by smtp.gmail.com with ESMTPSA id w10sm46101788pgo.80.2017.07.29.09.08.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jul 2017 09:08:42 -0700 (PDT) Received: by mail-pg0-f47.google.com with SMTP id k190so56786075pgk.5 for ; Sat, 29 Jul 2017 09:08:41 -0700 (PDT) X-Received: by 10.84.169.227 with SMTP id h90mr11326195plb.145.1501344521635; Sat, 29 Jul 2017 09:08:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.150.215 with HTTP; Sat, 29 Jul 2017 09:08:41 -0700 (PDT) X-Originating-IP: [81.153.222.202] In-Reply-To: References: Date: Sat, 29 Jul 2017 17:08:41 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Andrea Faulds Cc: Internals Content-Type: multipart/alternative; boundary="94eb2c11ba5ae5ee920555770290" Subject: Re: [PHP-DEV] json_encode() / json_decode() warnings From: php@duncanc.co.uk (Craig Duncan) --94eb2c11ba5ae5ee920555770290 Content-Type: text/plain; charset="UTF-8" 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. --94eb2c11ba5ae5ee920555770290--