Hi What's about unserialization? >
Yeah that's actually a good point! :) It could be handled by implicit object unserialization if the unserialize callback is NULL. However this is not optimal for performance and also create properties in the object which doesn't have to be necessary. There should be functions that help with parsing the string buffer that is passed to unserialize class callback. Sort of opposite to API for serialization. It should be part of RFC. I will add it. > Where does the state come from when recursively calling serialize? > I am not sure if I understand the question. The serialize_state will be a sort of wrapper for smart_str with some additions for checking whether the functions are called in correct order. The state instance will be in most cases a local variable (as it is in the example). In case you try to serialize object zval (using php_serailize_property_zval), it would try to serialize the object the same way and the resulted string would be added to the state buffer (will be in RFC...). Did I answer your question? I will try to clarify the RFC a bit. Any feedback would be much appreciated. Thanks. Jakub