Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100073 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52876 invoked from network); 28 Jul 2017 11:08:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2017 11:08:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.218.41 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.218.41 mail-oi0-f41.google.com Received: from [209.85.218.41] ([209.85.218.41:36242] helo=mail-oi0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/D1-40376-52B1B795 for ; Fri, 28 Jul 2017 07:08:22 -0400 Received: by mail-oi0-f41.google.com with SMTP id g131so130209681oic.3 for ; Fri, 28 Jul 2017 04:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Y7BA3rz0atsFZEjDO91AnBax20O5WB9/eNYuZqgjNpY=; b=h+AUIG+71aZxsxnny3SUn3yp58Uocx59CkLCdlvkJQhgh67wPvhlTl9VDyc3a1GJBf QYslCQJwb4yyPX7IwYvo/MDyN5LoCy4TB0IV7UJIyvsxSEaIWxO/CgLZAJGOz5Oz0LsC gkVZbY2772oZ9oIgxcrfqAMX4DfeuO7xae9EA= 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=Y7BA3rz0atsFZEjDO91AnBax20O5WB9/eNYuZqgjNpY=; b=q5OTb6oVvmVZgLU0VpaB5OLIUr0jgWZ6XUf2j/1W9p4oJYcoNqaHW8lG6ibKL9KLfR RQVzL4cykNBeFaPRYNjDeS4rUPNZmiypSVdwjLpqWvTYEbscGMyE9XCw3Mm0tbuMEdLl YCLfNl8x3vUyhAv1O08yNjYIlK5rZSK+dSvlwsUDka6AhA0AGy33MYnarB+2p8zNOhef Nh/UycKvxEErSoNlNDaGGJlIh1w1lxS/6bbBNqCCEAuF/YxhqZFJ4R4AFv0Pk8jt12gw o/4PN1pwfdrt2c3FiN2kS/uktq3ca2PQIIPSC5GwBjmmI9Gg39ytQHHMKNJ7glnpD4ln sK5A== X-Gm-Message-State: AIVw113XWVahj1ULPZuGfYHItLt9lAsKbsRs1vB2U63/vcBlCnSxQVMi XtUebXu1vmV0lZErofnRdtPhOA3dVbQx79Y= X-Received: by 10.202.79.84 with SMTP id d81mr6095106oib.50.1501240098866; Fri, 28 Jul 2017 04:08:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.115.69 with HTTP; Fri, 28 Jul 2017 04:08:18 -0700 (PDT) In-Reply-To: References: Date: Fri, 28 Jul 2017 14:08:18 +0300 Message-ID: To: Craig Duncan Cc: Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues From: narf@devilix.net (Andrey Andreev) Hi, On Fri, Jul 28, 2017 at 1:59 PM, Craig Duncan wrote: > Hi internals. > > As my initial thread about introducing warnings to the JSON functions was > not immediately flooded with disagreement I took the liberty of creating an > RFC for official discussion. > > The proposal is to have `json_encode()` and `json_decode()` raise warnings > whenever a failure occurs, instead of requiring the developer to call > `json_last_error()` each time. > > The functionality of `json_last_error()` and `json_last_error_msg()` are > unaffected and they can still be used in exactly the same way they are today > > https://wiki.php.net/rfc/json_encode_decode_errors > I too think that JSON error handling can be a bit tedious at times, but I certainly prefer it that way than having to suppress all json_decode() calls. Cheers, Andrey.