Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113237 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7959 invoked from network); 23 Feb 2021 18:33:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Feb 2021 18:33:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 180081804E4 for ; Tue, 23 Feb 2021 10:22:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 23 Feb 2021 10:22:06 -0800 (PST) X-Gm-Message-State: AOAM532CjeelgU675XjwxD4A1Am2892Hsbmh4FBG1RFN0ZZOh40yHrLc qwOSMFIFw/O89fLoeOVtNCU3F4vWeagqzPrcMaQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xpaw.me; s=default; t=1614104525; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=flZIgowVyqAVbKfwhxF8ZHBwX8U4lMmOQg6nxoQxOlw=; b=sHgfzAGGvxKrD54rIHPkmFFkmAJIZIFe/hlV3tTotbFSIKTFCJOTuhwpLB0qoL31mrgk7p gP4wSxKboL6p1ptsqMDEQEU6OYy+8aH2hRhuz0X8PmEhVw72nesvpKpjROaJUN2nUJw2RM 0OdHhx24NPnI/w3t4ca/AiB84pDBfX4= X-Google-Smtp-Source: ABdhPJw9lBWwUYZbyC5LGb/nEOM/i8paUNPz3ob7mcfk3bidiNgb+z8pmaIAydzshlsDZ90gGRNBsMYVWlw6xRT4vAs= X-Received: by 2002:aa7:d34e:: with SMTP id m14mr29706054edr.223.1614104525431; Tue, 23 Feb 2021 10:22:05 -0800 (PST) MIME-Version: 1.0 Reply-To: me@xpaw.me X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. Reply-To: Pavel Djundik Date: Tue, 23 Feb 2021 20:21:54 +0200 X-Gmail-Original-Message-ID: Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: me@xpaw.me Subject: Support JSON With Commas and Comments (JWCC) in json_decode From: internals@lists.php.net ("Pavel Djundik via internals") 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. Perhaps this could be disabled by default and made opt-in with a option flag? json_decode already supports passing in options. Is there any interest in this?