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
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
Hi,
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
Lukas,
Reading the spec it clearly says in the pre-amble that JSON can
represent both primitive and complex data types
From RFC:
JSON can represent four primitive types (strings, numbers, booleans,
and null) and two structured types (objects and arrays).
The RFC also says that when it
Lukas Kahwe Smith wrote:
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
The JSON grammar explicitly says that it's not supported.
2. JSON Grammar
A JSON text is a sequence of tokens. The set of tokens includes six
structural characters, strings, numbers, and three literal names.
A JSON text is a serialized object or array.
JSON-text = object / array
---
Please re-read my comments again. First of all RFC says that basic
types are support even identifies them by name, secondly it says you
MAY extend the syntax. What other languages do is fine and up to them
to implement, unless you want to make a case for making PHP a copy of
[language of
For reference I saw people use json_encode() to pass a string to
javascript into their page while avoiding bugs/XSS with stuff like
/script.
var foo = ?=json_encode($my_string)?;
... (yes, they maybe heared somewhere that JSON is *not* javascript, I
told 'em too).
This is not correct.
var foo = ?=json_encode($my_string)?;
... (yes, they maybe heared somewhere that JSON is *not* javascript, I
told 'em too).
JSON is a strict subset of JavaScript, and the above scenario is something I
also do often.
Since PHP generates web pages, any time I need to generate a JS literal
Stan Vassilev | FM wrote:
var foo = ?=json_encode($my_string)?;
... (yes, they maybe heared somewhere that JSON is *not* javascript, I
told 'em too).
JSON is a strict subset of JavaScript, and the above scenario is
something I also do often.
Since PHP generates web pages, any time I need
I'm not sure if that is the right way of looking at it though. I think
the only question is how to represent the scalar types, not whether they
should be allowed. As far as I am concerned it is obvious that they be
allowed and the JSON spec is quite explicit that JSON can be used to
Sorry for top posting. I see no reason why php should not interop with
javascript 100% as it should. I do not see a reason to create new
functions, parameters, etc. The existing should be expected to both
encode and decode json with javascript properly. If there is a
mismatch right now,
mike wrote:
Sorry for top posting. I see no reason why php should not interop with
javascript 100% as it should. I do not see a reason to create new
functions, parameters, etc. The existing should be expected to both
encode and decode json with javascript properly. If there is a mismatch
I can't give specifics (I'm mobile and I don't remember where the code
would be anyway) but we had an issue with php and javascript exchange
via json where the php output using json_encode and we had to wrap it
with additional braces for it to be usable. Sorry for being vague,
this thread
Yes, but that would be going to a json_parse thing somewhere, not pure
Javascript.
-Rasmus
mike wrote:
I can't give specifics (I'm mobile and I don't remember where the code
would be anyway) but we had an issue with php and javascript exchange
via json where the php output using json_encode
15 matches
Mail list logo