Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42237 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95584 invoked from network); 13 Dec 2008 18:21:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2008 18:21:58 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:38544] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/17-47862-54DF3494 for ; Sat, 13 Dec 2008 13:21:58 -0500 Received: from [216.145.54.15] (socks3.corp.yahoo.com [216.145.54.15]) (authenticated bits=0) by mail.lerdorf.com (8.14.3/8.14.3/Debian-6) with ESMTP id mBDILr4f003032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 13 Dec 2008 10:21:54 -0800 Message-ID: <4943FD41.1020806@lerdorf.com> Date: Sat, 13 Dec 2008 10:21:53 -0800 User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Ilia Alshanetsky , Scott MacVicar , PHP Developers Mailing List References: <2D85B33E-889B-4214-9BB8-A12EFFFC641E@macvicar.net> <996B6F15-A0BC-4DE9-9486-BD7716F543C1@pooteeweet.org> In-Reply-To: <996B6F15-A0BC-4DE9-9486-BD7716F543C1@pooteeweet.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Removing basic types from our JSON parser From: rasmus@lerdorf.com (Rasmus Lerdorf) Lukas Kahwe Smith wrote: > > On 13.12.2008, at 18:59, Ilia Alshanetsky wrote: > >> >> On 12-Dec-08, at 10:50 PM, Scott MacVicar wrote: >> >>> Hi All, >>> >>> Basic types were added to our JSON decoder to PHP 5.2.1, this allows >>> one to use json_encode / json_decode on any of our scalar types. Omar >>> correctly identified #38680 as not a bug but it appears that Ilia >>> added support for this anyway violating the RFC [1]. Maybe there was >>> a reason for this but I'm not sure why? >> >> PHP is typeless language, IMO its conductive to this design to allow >> encoding of basic types via json_encode, it reduces the code when >> communicating to/form JavaScript to avoid type detection. While it >> does violate the RFC IMO the convenience of the feature is definitely >> worth it. > > > well seems to me like its safer to stick with RFC as the default. if at > all this should be optional. JSON is a standard and this requires > everybody to follow it. so using something else should be a conscious > decision that is also visible during code review. I still don't see where in the RFC it says that *only* arrays and objects can be represented. I can bring forth the power of Douglas Crockford (who sits next to me at Yahoo) to put an end to this one on Monday. -Rasmus