php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #80791 Support JSON With Commas and Comments (JWCC) in json_decode
Submitted: 2021-02-23 12:44 UTC Modified: 2021-02-23 15:25 UTC
From: php-bugs at xpaw dot me Assigned:
Status: Suspended Package: JSON related
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php-bugs at xpaw dot me
New email:
PHP Version: OS:

 

 [2021-02-23 12:44 UTC] php-bugs at xpaw dot me
Description:
------------
See https://nigeltao.github.io/blog/2021/json-with-commas-comments.html for more information.

It is quite common to have trailing commas in JSON, and a lot of parsers support it. I believe this could be trivially supported by PHP, even if you skip adding support for comments.

Test script:
---------------
json_decode( '{"a":1,}', JSON_THROW_ON_ERROR );


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-23 15:25 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2021-02-23 15:25 UTC] cmb@php.net
This feature request requires discussion for which this bug
tracker is not suitable.  Please pursue the RFC process[1].  For
the time being, I'm suspending this ticket.

[1] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Nov 29 10:03:14 2021 UTC