Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33624 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61551 invoked by uid 1010); 4 Dec 2007 04:59:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61536 invoked from network); 4 Dec 2007 04:59:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2007 04:59:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=pollita@php.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pollita@php.net; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain php.net designates 140.211.166.39 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pollita@php.net X-Host-Fingerprint: 140.211.166.39 osu1.php.net Linux 2.4/2.6 Received: from [140.211.166.39] ([140.211.166.39:60313] helo=osu1.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/6D-52978-7CED4574 for ; Mon, 03 Dec 2007 23:59:52 -0500 DomainKey-Signature: q=dns; a=rsa-sha1; c=nofws; s=mx; d=php.net; h=From:Subject:To:Date; b=JpxpCr+aAD+RUxCwS2rjf0aZhEmTN4VkCSUKyGAnSyrvVXj/Md2n4bUIvB4B2Ir5 bL7UmX3ba6mK7KM9HlaGrtzM4vgfBeCBsU1vBvvKqRWKBGbLdQHEZQDEc5t3K9kT Authentication-Results: osu1.php.net smtp.mail=pollita@php.net; spf=neutral; sender-id=neutral Authentication-Results: osu1.php.net header.from=pollita@php.net; sender-id=neutral Authentication-Results: osu1.php.net smtp.user=pollita; auth=pass (LOGIN) Received: from [216.145.49.15] ([216.145.49.15:46150] helo=[10.72.72.170]) by osu1.php.net (envelope-from ) (ecelerity 2.2.1.23 r(20596)) with ESMTPSA (cipher=none) id EB/30-11976-FBED4574; Mon, 03 Dec 2007 20:59:44 -0800 Message-ID: <4754DEA0.10105@php.net> Date: Mon, 03 Dec 2007 20:59:12 -0800 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Alan Knowles CC: Stanislav Malyshev , Rasmus Lerdorf , PHP Internals References: <474F0EE7.8020201@php.net> <474F4E47.8050506@zend.com> <474F5E12.1050404@php.net> <474F5F75.3030808@zend.com> <475081DD.90404@php.net> <4750B3CA.20405@zend.com> <475101FF.5080103@lerdorf.com> <475482AF.3050800@zend.com> <47548638.9020709@lerdorf.com> <475487D0.7050207@zend.com> <47549512.1000505@akbkhome.com> In-Reply-To: <47549512.1000505@akbkhome.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposed feature for json_encode() From: pollita@php.net (Sara Golemon) > One thing to consider is changing json_encode to add a header > Content-type: application/json (or x-javascript), unless the additional > arguments are used.. > That way someone using the function to intermingle with HTML will be > faced with the fact they have to encode the output, otherwise it breaks > the page... > ob_iconv_handler() does something similar to this and I consider it a mistake as: ob_start('ob_iconv_handler'); echo "Foo"; ob_flush(); echo "Bar"; Will result in a headers already sent message, even though no explicit attempt is made to send headers. I've been meaning to come up with a BC fix for this... In time for 5.3 at least... -Sara