Em qua, 4 de jul de 2018 19:01, Nikita Popov
escreveu:
> On Fri, Jun 29, 2018 at 8:51 PM, David Rodrigues
> wrote:
>
>> Hello. I saw that JS supports the x-notation (\x40) and u-notation
>> (\u0040), but PHP only supports u-notation. There some reason for that?
>>
>> JSON.parse('"\x40"'); // =>
On Fri, Jun 29, 2018 at 8:51 PM, David Rodrigues
wrote:
> Hello. I saw that JS supports the x-notation (\x40) and u-notation
> (\u0040), but PHP only supports u-notation. There some reason for that?
>
> JSON.parse('"\x40"'); // => @
> JSON.parse('"\u0040"'); // => @
>
No it doesn't. JSON.parse(
On Fri, Jun 29, 2018 at 1:51 PM, David Rodrigues wrote:
> Hello. I saw that JS supports the x-notation (\x40) and u-notation
> (\u0040), but PHP only supports u-notation. There some reason for that?
>
The TL;DR version AIUI, is that JSON strings are Unicode strings, so
any byte sequence in a JSON
Hello. I saw that JS supports the x-notation (\x40) and u-notation
(\u0040), but PHP only supports u-notation. There some reason for that?
JSON.parse('"\x40"'); // => @
JSON.parse('"\u0040"'); // => @
While PHP:
json_decode('"\\u0040"'); // => @
json_decode('"\\x40"'); // => null (Syntax error)