Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35156 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24941 invoked by uid 1010); 4 Feb 2008 08:24:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 24926 invoked from network); 4 Feb 2008 08:24:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2008 08:24:23 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=permerror; sender-id=softfail Received-SPF: error (pb1.pair.com: domain zend.com from 212.25.124.163 cause and error) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 bzq-25-124-163.static.bezeqint.net Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:50121] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/72-07314-2BBC6A74 for ; Mon, 04 Feb 2008 03:24:23 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 4 Feb 2008 03:52:04 +0200 Received: from [192.168.17.48] ([192.168.17.48]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 3 Feb 2008 17:52:00 -0800 Message-ID: <47A66FBF.1040004@zend.com> Date: Sun, 03 Feb 2008 17:51:59 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Derick Rethans CC: 'PHP Internals' References: <479A60BA.7030905@zend.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Feb 2008 01:52:00.0976 (UTC) FILETIME=[8885CD00:01C866D0] Subject: Re: [PHP-DEV] json_encode() bug From: stas@zend.com (Stanislav Malyshev) > Like I mentioned before (I think), it should not return an empty string > of course because programmatically it's not possible to check for this. > As most of our functions return false in those cases, so should this > function. AFAIR false is not valid JSON, so it would break a lot of code. Also, I am not sure we should change json_encode to return false on whole structure if one of the fields contains invalid utf-8. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com