Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61031 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86426 invoked from network); 28 Jun 2012 18:36:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jun 2012 18:36:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:47425] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/05-62543-C34ACEF4 for ; Thu, 28 Jun 2012 14:36:45 -0400 Received: by lbgc1 with SMTP id c1so3926843lbg.29 for ; Thu, 28 Jun 2012 11:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Fq8fE4v06fpJBVzQSx798+HBYQQgS/x3jzS+Ce16uMU=; b=zn0vF54pBwIUGr2V722mv8jEo3JNYRocXUk7OwtT0lRqZ6QNQiTir/4MxETGiafy+/ 6UyTO2mfnscBxJ4kSumTwzpXlUSKn6PAo03KAnxUehDQ68lRUc91onCPJuFe7GTPc59G L9EMZqwMl95Ba0BCGppHD9JDXJkLjGRIJpDPix6APVnUBGTDLthjozFWXykkET/HGEP0 KS9CdoqR02wTiEs7XWNdjDqmXHUOmSOwhe7iUN2FzOPkVexb7ZPnrq9esDsabiWqi/I/ r9JyN1Zz4MikZd03+Cf2VAv6Wf9HpthxEr/tvgqBJuR3UGT402eRCe6s4w3A2NwkbZsa oiRw== MIME-Version: 1.0 Received: by 10.112.104.100 with SMTP id gd4mr1652904lbb.24.1340908600856; Thu, 28 Jun 2012 11:36:40 -0700 (PDT) Received: by 10.152.114.70 with HTTP; Thu, 28 Jun 2012 11:36:40 -0700 (PDT) In-Reply-To: References: <20120621141241.GA25789@analysisandsolutions.com> <4FE33EDF.2000409@lerdorf.com> <4FE61E9D.5050908@sugarcrm.com> <4FE734C4.2010706@lerdorf.com> <4FEA489D.1010601@sugarcrm.com> Date: Thu, 28 Jun 2012 20:36:40 +0200 Message-ID: To: Nikita Popov Cc: Pierre Joye , Benjamin Eberlei , Stas Malyshev , Rasmus Lerdorf , 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@gmail.com (Nikita Popov) On Wed, Jun 27, 2012 at 2:19 PM, Nikita Popov wrote: > I looked at a few other error functions (of which we by the way we > have *loads*, which is a bad sign) and indeed it seems that they all > use a separate function to get the error message. Most use a > xyz_errno() + xyz_error() pair. > > So it seems reasonable to instead provide the functionality via > json_last_error_msg(). I replaced json_last_error(true) with json_last_error_msg() now (in https://github.com/php/php-src/commit/974324676b2436f159f42d9241c569f813471684). I kind of get the feeling that the changes turned out much more intrusive than originally thought. Maybe the best thing to do would be to revert all changes on 5.3/5.4 (including the very original one that landed only on 5.3) and only introduce the new behavior on master. Or do you think that the changes are okay for the release branches? Nikita