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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Sat Dec 04 21:03:34 2021 UTC