When encoding PHP objects as JSON, all public properties of that object will be encoded in a JSON object.
JSON does not allow object references, so care should be taken not to
encode objects with recursive references. If you have issues with
Zend_Json_Encoder::encode() allow an optional second
parameter to check for recursion; if an object is serialized twice, an
exception will be thrown.
Zend_Json will decode JSON objects as
associative arrays. However, if you desire an object returned, you can
// Decode JSON objects as PHP objects $phpNative = Zend_Json::decode($encodedValue, Zend_Json::TYPE_OBJECT);
Any objects thus decoded are returned as
with properties corresponding to the key/value pairs in the JSON
The recommendation of the Zend Framework is that the individual
developer should decide how to decode JSON objects. If an object of a
specified type should be created, it can be created in the developer
code and populated with the values decoded using