Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100546 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17806 invoked from network); 12 Sep 2017 16:47:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2017 16:47:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.171 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.161.171 mail-yw0-f171.google.com Received: from [209.85.161.171] ([209.85.161.171:35538] helo=mail-yw0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/06-10715-48F08B95 for ; Tue, 12 Sep 2017 12:47:00 -0400 Received: by mail-yw0-f171.google.com with SMTP id q80so29460824ywg.2 for ; Tue, 12 Sep 2017 09:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=kkW6jZ263kWlq+aGa2y8g8lljUH4HDtDIJRxKJa73hw=; b=o0bDbc4P+bNsF0dCay9gcgXFRYGesT7WaN5eSN8+ZxUn6ZVp57YCiKuvl7jQJadvKF RyFcCdWkMjcfeiElbCjmynm3Cqs/u3hrqkyW74YFHQQ0pQmh4abjhDTzRBAhvMzSN1jT iwIF6GgQzFNzV2IR7ULQ1tYQOObW9/czMNQTElqwNZNfiQMJ4t86UjMeVN5LwOD8DfBf aKcIs+mlbNlCCly99HBQEZjjH83/HWj7sGVXsEkVzhtiYPsOM/W4j0kd5Pd5v/bWOGZL SPXeZt27l2Fts207t1172aFEF1mwOQMDVCkEJ3aSYpUmB3xtnAIFOZD9dy42l4dU1P2t G08A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=kkW6jZ263kWlq+aGa2y8g8lljUH4HDtDIJRxKJa73hw=; b=LaL1Tm8zoGn7q5qbEkcCUS1nvXmvYej0/cFeQjBqD5b+o77nVNjlrAkTp9PB9N4bwc LZaeYfa6ZeoWnDQtY5PSxv9d33JLdBWxzqTw0bht/FOVLJlepjMPq8BhJs48pv86K4Sj T/UmF3ASw7GcCblSrzKmJV0a7lgOrVEVzQ+RQmoF1K7i5eLfc1WDNLNiMGMQTQk2aDOt P4k6Bi9Yn8h5f6BQ4sMvKyQcLtpDjOFz3jzWQjeNrWJxnvBi31GkD+VGJeKHbb60FkkW ouGxF5ldEtKD9pB0EiGcGqVj25BU1/75B8IyP0H244mkTBH/D8lNLQsWVMHsIvPrkIOa uU2w== X-Gm-Message-State: AHPjjUirg3CSibRcYHqKAmrJwZ/KnGW0R90+ypw1UMq5CxUrj1yBVHBa WTIZXfCtTLEZgNo8J88uw1OEyP+VWH8N X-Google-Smtp-Source: AOwi7QCpPLDG+ofRoOc6OvkZ5/7/iTP9P22uCYbe4lnCq7yIgkNS35NSeD+c7txlk+grK7e4LefeFtdaqySBl61VI7s= X-Received: by 10.37.173.199 with SMTP id d7mr7248071ybe.361.1505234818002; Tue, 12 Sep 2017 09:46:58 -0700 (PDT) MIME-Version: 1.0 Sender: jakub.php@gmail.com Received: by 10.129.108.201 with HTTP; Tue, 12 Sep 2017 09:46:57 -0700 (PDT) In-Reply-To: <82.9A.10715.73494B95@pb1.pair.com> References: <82.9A.10715.73494B95@pb1.pair.com> Date: Tue, 12 Sep 2017 17:46:57 +0100 X-Google-Sender-Auth: spPRPBM8NbbFlr7wpI7OEQ0VFnI Message-ID: To: Andrea Faulds Cc: PHP internals list Content-Type: multipart/alternative; boundary="f403045eb1b6a18a03055900caf4" Subject: Re: [PHP-DEV] [RFC] [Discussion] JSON_THROW_ON_ERROR From: bukka@php.net (Jakub Zelenka) --f403045eb1b6a18a03055900caf4 Content-Type: text/plain; charset="UTF-8" On Sun, Sep 10, 2017 at 2:24 AM, Andrea Faulds wrote: > Hi everyone, > > Craig Duncan previously sparked discussion here about JSON's > error-handling behaviour. Unfortunately, his attempt to change it seems not > to have gone anywhere, but I have his blessing to try this other approach > instead. > > So here's an RFC: https://wiki.php.net/rfc/json_throw_on_error > > The feature can be described in a single paragraph (in fact, the title is > pretty much enough, the patch is just detail) but it's better to go through > the proper RFC process. > > Please tell me what you think. > > I think that it makes sense in general. There are just couple of things that are not described in RFC. Currently it has higher priority than JSON_PARTIAL_OUTPUT_ON_ERROR. I think that if someone specify this constant, then the partial output is required and it should be preferred. In any case I think it should be in the RFC what the behavior is. Another thing is the logic of setting global json error. Currently it just reset the error value so the next call to json_last_error() will return 0 (no error) even though there was an error which is in the exception code. I think that the behavior should be either not resetting the global error value at all (the previous error should be kept) or setting the global error value so the json_last_error returns the same value as exception code or 0 if no error. Again it would be good to mention the behavior in the RFC so we prevent a new discussion in the PR... :) Cheers --f403045eb1b6a18a03055900caf4--