php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57468 decode choking on js comments
Submitted: 2007-01-05 08:34 UTC Modified: 2008-12-18 21:31 UTC
From: jan at horde dot org Assigned:
Status: Not a bug Package: json (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jan at horde dot org
New email:
PHP Version: OS:

 

 [2007-01-05 08:34 UTC] jan at horde dot org
Description:
------------
json_decode() doesn't decode json data that contains comments.

Reproduce code:
---------------
var_dump(json_decode("{ /* comment inside */ }"));

Expected result:
----------------
object(stdClass)(0) {
}


Actual result:
--------------
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-18 21:31 UTC] scottmac@php.net
Comments are not valid JSON data, JSON doesn't support all of 
the JavaScript tokens.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC