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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC