|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-06-05 10:53 UTC] marandall@php.net
[2021-06-05 11:03 UTC] cmb@php.net
-Status: Open
+Status: Wont fix
-Assigned To:
+Assigned To: cmb
[2021-06-05 11:03 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 17:00:01 2025 UTC |
Description: ------------ Can you please: 1. add an option to send unquoted keys smth like JSON_UNQUTED_KEYS. 2. make json_decode to be able to decode json with unquoted keys. Now json_decode returns null if given a specification-correct json with no key quotes. Json specification allows keys to be unquoted. If json keys are unquoted this saves up to 5-25% of json file size. 5-25% is a lot. This is a bit similar to JSON_UNESCAPED_UNICODE. If you send non-latin json safe chars with your utf8 webserver this is a big overhead in json file size. 5-25% too. Test script: --------------- json_encode(["a"=>"b"],JSON_UNQUOTED_KEYS|JSON_UNESCAPED_UNICODE); Expected result: ---------------- {a:"b"} Actual result: -------------- {"a":"b"}