Re: RFC: Short syntax for Arrays (redux)
| From: | Andrei Zmievski | Date: | Mon, 06 Jun 2011 03:49:04 +0000 |
| Subject: | Re: RFC: Short syntax for Arrays (redux) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52997@lists.php.net to get a copy of this message | ||
On Sat, Jun 4, 2011 at 4:52 AM, David Zülke
<david.zuelke@bitextender.com> wrote:
> Yes, I know. Then why are you and others demanding that the resulting syntax be fully
> compatible with JSON so it could be parsed by other JSON parsers? That makes no sense at all. A file
> with just ["foo"] in it won't be interpreted by PHP; you need at least <?php ?>
> wrappers and a semicolon, and then you can't just throw it at another JSON parser anymore.
I never demanded that anything resembling this. I simply stepped into
this thread because of the encoding argument that ensued.
> There is absolutely no use case for this, but some people on this thread seem to have some
> weird dream where they can somehow share code between languages or whatever. Which they can't.
> Unless they want to start stripping or padding stuff and generating code.
>
> I was pointing out the encoding issue under the assumption that it somehow *did* make sense,
> e.g. that you'd have a JSON compatible declaration somewhere in a PHP file, extracted it with,
> say, a regex, and handed it to PHP's own JSON parser, which might then struggle depending on
> the encoding of the file.
My impression was that people just wanted a JSON-like way to construct
arrays and objects. Which does not require using a JSON parser, just
the Zend parser.
-Andrei