Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52731 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73185 invoked from network); 1 Jun 2011 23:53:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2011 23:53:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=shadda@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=shadda@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.173 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: shadda@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-px0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:61201] helo=mail-px0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/EB-32367-E01D6ED4 for ; Wed, 01 Jun 2011 19:53:50 -0400 Received: by pxi16 with SMTP id 16so177853pxi.18 for ; Wed, 01 Jun 2011 16:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=+4ESLMsjgcvBACDyo16L1psuZNVIZ10KjGR155qX+RE=; b=LbVrweWib6Onsoumtj0P1pFxr+Z+RaULenSzu4Q5BnKqe5UjtB6JssJsWws8w5bJr1 F75RkcGHsmAOgPLysixTs2QdqoQgnho5qwEZrD1P+l2dosN2eRmRVgkByh0SUBRmgI89 rw82s8c4p7jpOqh9PTq72iAb+M8f5DkLGhnEI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=AteKYshuAURSjg+we6S6cDfHXJty+wclRdj5EVnc5pkG/blXyjnRdiXsFSVWJBh+gt x6pMKPKZT5/e46GEzBxNjUiuuAG+IWVtXj6aAN9KBh1UlZuhU2hPJiiW6Es9U8fspNAD zmQwOlot7zH4EHzymsPIziB+x6Ss+K4el2wVA= Received: by 10.143.21.28 with SMTP id y28mr12693wfi.211.1306972426543; Wed, 01 Jun 2011 16:53:46 -0700 (PDT) Received: from [192.168.1.100] ([98.156.62.98]) by mx.google.com with ESMTPS id q13sm45791wfd.23.2011.06.01.16.53.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2011 16:53:45 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Wed, 1 Jun 2011 18:51:39 -0500 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <0800435D-010A-4F06-BD5F-33220D5B0065@gmail.com> References: <4DE5368A.6050603@moonspot.net> <8BEEEE49-8DA3-4634-BF9C-120F7A15B613@roshambo.org> To: John Crenshaw X-Mailer: Apple Mail (2.1084) Subject: Re: [PHP-DEV] RFC: Short syntax for Arrays (redux) From: shadda@gmail.com (Matt Wilson) The issue I have with that is that, regardless of the syntax chosen, = even if it meant a 100% inline JSON syntax, you would still (for obvious = reasons) need to parse any JSON string into PHP structures. You still = have to do json_load($php_or_json_string) or (god have mercy) = eval($string). At that point, the only convenience you get from having = JSON syntax in php is the situational ability to copy a JSON string = directly into your source code.=20 I just don't think that's worth introducing a new kind of array/object = syntax into PHP. I might prefer that syntax (like python) but I don't = think it's right for this language. On Jun 1, 2011, at 6:28 PM, John Crenshaw wrote: > I don't think anyone cares about JSON for the sake of being perfect = JSON, I didn't intend to give that impression. I'm only hoping for = something that generally works on par with all the other JSON parsers in = the world. In other words something with roughly the same syntax, = constraints, and flexibility as the average browser based JavaScript = implementation. Making JSON some special totally separate object type = would totally miss the point and meaning of any developer writing such = code. Yes, JSON is a very specific encoding, but when a developer writes = something "jsony", what they mean is "an object/array with the following = structure/values", because that is what the encoding really represents. >=20 > John Crenshaw > Priacta, Inc. >=20 > -----Original Message----- > From: dukeofgaming [mailto:dukeofgaming@gmail.com]=20 > Sent: Wednesday, June 01, 2011 6:52 PM > To: Michael Shadle > Cc: Sean Coates; Anthony Ferrara; PHP internals > Subject: Re: [PHP-DEV] RFC: Short syntax for Arrays (redux) >=20 > I still don't get it, the idea of making it look like json wont make = it > json, it will be PHP, and if you dare to write you "jsony" = object/array with > single quoted strings wont break the code even when its not JSON. >=20 > I'll say it again: not even Javascript supports 100% valid JSON. I'll = say it > even more times: >=20 > Not even Javascript supports 100% valid JSON > Not even Javascript supports 100% valid JSON > Not even Javascript supports 100% valid JSON > Not even Javascript supports 100% valid JSON > Not even Javascript supports 100% valid JSON >=20 > JSON even has its own mime type. The idea of JSON as a first-class = citizen > is a fallacy IMHO. The concept itsel is not ugly, but for god's sake, = lets > put it in a separate RFC and lets decide con the actual RFC. Perhaps = the > JSON idea could benefit from autoboxing and a native class?: > https://wiki.php.net/rfc/autoboxing >=20 > JSON is a serializarion format, not a data structure, you coud write = an > associative array and if PHP knew the way, it could be autointerpreted = as > JSON, no need to make PHP code look like JSON. I think that the = *BEHAVIOR* > of arrays/objects as JSON and without the intervention of = serialization > functions should be in a separate RFC. There is really no point to = make PHP > *look* like JSON to handle JSON natively . >=20 > This JSON matter and short array/object syntax are different issues = just the > way "=20 > Could someone get Douglas Crockford in here?, rofl. >=20 > Regards, >=20 > David >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20