Index: library/Zend/Json/Decoder.php =================================================================== --- library/Zend/Json/Decoder.php (revision 24547) +++ library/Zend/Json/Decoder.php (working copy) @@ -236,6 +236,9 @@ // Create new StdClass and populate with $members $result = new StdClass(); foreach ($members as $key => $value) { + if ($key === '') { + $key = '_empty_'; + } $result->$key = $value; } break; Index: tests/Zend/JsonTest.php =================================================================== --- tests/Zend/JsonTest.php (revision 24547) +++ tests/Zend/JsonTest.php (working copy) @@ -887,6 +887,19 @@ $json = Zend_Json::encode($array); $this->assertEquals($expected, $json); } + + /** + * @group ZF-7586 + */ + public function testWillDecodeStructureWithEmptyKeyToObjectProperly() + { + Zend_Json::$useBuiltinEncoderDecoder = true; + + $json = '{"":"test"}'; + $object = Zend_Json::decode($json, Zend_Json::TYPE_OBJECT); + $this->assertTrue(isset($object->_empty_)); + $this->assertEquals('test', $object->_empty_); + } }