|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesLoL (last revision 2011-08-04 00:59 UTC by fkkkkkkkkkkk at hotmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-08-03 23:21 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: iliaa
[2011-08-03 23:21 UTC] felipe@php.net
[2011-08-04 13:23 UTC] iliaa@php.net
-Status: Assigned
+Status: Bogus
[2011-08-04 13:23 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Description: ------------ When using json_encode with JSON_NUMERIC_CHECK, json_encode still converts all array keys to a string, instead of keeping integer keys as integer. However, the JSON_NUMERIC_CHECK option does work correctly on all the array values. Test script: --------------- <?php $array = array ( 1 => "foo", 5 => "bar", "10" => 50, ); echo json_encode ($array, JSON_NUMERIC_CHECK); ?> Expected result: ---------------- {1:"foo",5:"bar","10":50} Actual result: -------------- {"1":"foo","5":"bar","10":50}