diff --git a/hphp/runtime/ext/JSON_parser.cpp b/hphp/runtime/ext/JSON_parser.cpp index 9970d4da3..18a18cbcb 100644 --- a/hphp/runtime/ext/JSON_parser.cpp +++ b/hphp/runtime/ext/JSON_parser.cpp @@ -551,6 +551,8 @@ bool JSON_parser(Variant &z, const char *p, int length, bool assoc/**/, empty } */ case -9: + attach_zval(the_json, JSON(the_kstack)[JSON(the_top)], assoc); + if (!pop(the_json, MODE_KEY)) { return false; } diff --git a/hphp/test/slow/json/emptydict.php b/hphp/test/slow/json/emptydict.php new file mode 100644 index 000000000..44282e271 --- /dev/null +++ b/hphp/test/slow/json/emptydict.php @@ -0,0 +1,11 @@ + + array(0) { + } + ["spaceId"]=> + int(3) +}