Re: RFC: Short syntax for Arrays (redux)
| From: | dukeofgaming | Date: | Wed, 01 Jun 2011 22:51:52 +0000 |
| Subject: | Re: RFC: Short syntax for Arrays (redux) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52726@lists.php.net to get a copy of this message | ||
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.
I'll say it again: not even Javascript supports 100% valid JSON. I'll say it
even more times:
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
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
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 .
This JSON matter and short array/object syntax are different issues just the
way "<?=" and "<?" were.
Could someone get Douglas Crockford in here?, rofl.
Regards,
David