Parsing together strings that mix single and double quotes, variables, defined constants and etc, makes the problem significantly worse, not better. So, json_encode is not a solution at all.
It's also not about PHP vs Node in any way; it's about interacting with APIs that make heavy use of JSON or JSON-superset notations. - M. -- Marcel Esser Vice President of Engineering, CROSCON +1 (202) 470-6090 marcel.es...@croscon.com Before printing this e-mail, please consider the rainforest. On 6/1/11 6:17 PM, "Michael Shadle" <mike...@gmail.com> wrote: >On Wed, Jun 1, 2011 at 3:09 PM, Sean Coates <s...@seancoates.com> wrote: > >> This is not about saving five characters every time I type array(), >>it's about making my systems all work together in a way that's a little >>less abstracted, and a lot less prone to error. > >Why not make your data in JSON and then $foo = json_encode($data) ? > >Why try to adopt JSON to PHP, just so it matches another language's >format? > >You do realize adding JavaScript syntax for arrays will only make that >consistent with JavaScript, otherwise you're still coding PHP with PHP >syntax, functions, etc. for everything else. That argument seems moot. >If you're more comfortable with JavaScript, start developing in node >if that is your cup of tea. > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php