Req #80791 [NEW]: Support JSON With Commas and Comments (JWCC) in json_decode
| From: | php-bugs at xpaw dot me | Date: | Tue, 23 Feb 2021 12:44:47 +0000 |
| Subject: | Req #80791 [NEW]: Support JSON With Commas and Comments (JWCC) in json_decode | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232350@lists.php.net to get a copy of this message | ||
From: php-bugs at xpaw dot me
Operating system:
PHP version: Irrelevant
Package: JSON related
Bug Type: Feature/Change Request
Bug description:Support JSON With Commas and Comments (JWCC) in json_decode
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 );
--
Edit bug report at https://bugs.php.net/bug.php?id=80791&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80791&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80791&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80791&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80791&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80791&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80791&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80791&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80791&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80791&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80791&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80791&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80791&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80791&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80791&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80791&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80791&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80791&r=mysqlcfg