Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60970 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26778 invoked from network); 26 Jun 2012 22:48:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2012 22:48:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:58742] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/7C-49439-25C3AEF4 for ; Tue, 26 Jun 2012 18:48:51 -0400 Received: by lbgc1 with SMTP id c1so846097lbg.29 for ; Tue, 26 Jun 2012 15:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Fl2HVV5EtnRNm8vKG8LeYda80VfKz0lMlj0Jto0ZkaI=; b=UlW1I/9NEhZZeMdi+0cB3cxN7q6TlB2Un4sbBx4FjHFVMDuRTrO38k+DvRu5KCTodW QsTy4esrIg29PIfO8qh6eORyrPuKVVCdN0CH8n9W2xA+egESIGMgT1VImteXFg2yb1tr OJVztnEX6oDEjk5bu4zRZi7yStOQ4YjciKcq0D4ktzrf+byMueh7gwtkZKXcSwLVQo6b dMDFvESesLMxcABR95oHpLolbQ9XZF28q4KxT+/T5gk8zACROLg0sFp7E0EDYjwf/33g HnhiAW+eYWbmkKedJezhwFQWrsjP7W3zytdOjlKNURsppIhQCCtq+e0/YQY10wCBUPk6 jLkQ== MIME-Version: 1.0 Received: by 10.112.49.68 with SMTP id s4mr8467553lbn.27.1340750927663; Tue, 26 Jun 2012 15:48:47 -0700 (PDT) Received: by 10.152.114.70 with HTTP; Tue, 26 Jun 2012 15:48:47 -0700 (PDT) In-Reply-To: <4FE734C4.2010706@lerdorf.com> References: <20120621141241.GA25789@analysisandsolutions.com> <4FE33EDF.2000409@lerdorf.com> <4FE61E9D.5050908@sugarcrm.com> <4FE734C4.2010706@lerdorf.com> Date: Wed, 27 Jun 2012 00:48:47 +0200 Message-ID: To: Rasmus Lerdorf Cc: Gustavo Lopes , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] json_encode() behavior for incorrectly encoded strings From: nikita.ppv@googlemail.com (Nikita Popov) On Sun, Jun 24, 2012 at 5:39 PM, Rasmus Lerdorf wrote: > So how about: > > mixed json_last_error ( [bool $error_string = false] ) > > Returns the last error (if any) occurred during the last JSON > encoding/decoding. By default an integer constant from the table below > is returned. If $error_string is true, an array containing both the > error constant and a string representation of the error is returned. Makes sense to me. So should I do this? Remove warnings + add string parameter for json_last_error? Nikita