Req #80791 [Opn->Sus]: Support JSON With Commas and Comments (JWCC) in json_decode

From: Date: Tue, 23 Feb 2021 15:25:38 +0000
Subject: Req #80791 [Opn->Sus]: Support JSON With Commas and Comments (JWCC) in json_decode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232357@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80791&edit=1 ID: 80791 Updated by: cmb@php.net Reported by: php-bugs at xpaw dot me Summary: Support JSON With Commas and Comments (JWCC) in json_decode -Status: Open +Status: Suspended Type: Feature/Change Request Package: JSON related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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> Previous Comments: ------------------------------------------------------------------------ [2021-02-23 12:44:47] 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 ); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80791&edit=1

« previous php.bugs (#232357) next »