Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42234 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91578 invoked from network); 13 Dec 2008 18:07:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2008 18:07:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:57521] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/46-47862-4F9F3494 for ; Sat, 13 Dec 2008 13:07:48 -0500 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id B99141EBC01B; Sat, 13 Dec 2008 18:12:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i8UQcMFm9HTN; Sat, 13 Dec 2008 19:11:48 +0100 (CET) Received: from [192.168.0.108] (77-58-151-147.dclient.hispeed.ch [77.58.151.147]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 736291EBC01A; Sat, 13 Dec 2008 19:11:47 +0100 (CET) Cc: Scott MacVicar , PHP Developers Mailing List Message-ID: <996B6F15-A0BC-4DE9-9486-BD7716F543C1@pooteeweet.org> To: Ilia Alshanetsky In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Sat, 13 Dec 2008 19:05:18 +0100 References: <2D85B33E-889B-4214-9BB8-A12EFFFC641E@macvicar.net> X-Mailer: Apple Mail (2.929.2) Subject: Re: [PHP-DEV] Re: Removing basic types from our JSON parser From: mls@pooteeweet.org (Lukas Kahwe Smith) 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. regards, Lukas Kahwe Smith mls@pooteeweet.org