Req #69936 [Fbk->NoF]: enhancement to json_decode -- an option to keep duplicate keys in an array

From: Date: Sun, 05 Jul 2015 04:22:19 +0000
Subject: Req #69936 [Fbk->NoF]: enhancement to json_decode -- an option to keep duplicate keys in an array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194133@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69936&edit=1 ID: 69936 Updated by: php-bugs@lists.php.net Reported by: floriparob at gmail dot com Summary: enhancement to json_decode -- an option to keep duplicate keys in an array -Status: Feedback +Status: No Feedback Type: Feature/Change Request Package: JSON related Operating System: Debian stretch/sid PHP Version: 5.6.10 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2015-06-26 01:49:53] requinix@php.net What am I saying? {a:1,a:2} doesn't make sense as JSON either. Do you have any examples of where this would be useful *and* are not due to flawed JSON encoders? ------------------------------------------------------------------------ [2015-06-26 01:47:39] requinix@php.net That's not possible: arrays can't have duplicate keys. What if it decoded into an array of values? Like {a:1,a:2} decoded to [a=>[1,2]]? ------------------------------------------------------------------------ [2015-06-26 01:42:00] floriparob at gmail dot com Description: ------------ Using json_decode to turn a JSON string into an associative array. If it finds duplicate key:value pairs it drops the duplicate. It would be handy to have an option to keep or not to keep these duplicates. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69936&edit=1

« previous php.bugs (#194133) next »