Does anyone know a library that allows serialization of data in C ++ so that it can be deserialized using the "unserialize" function by default?
There are several implementations for other languages ββhere.
http://objectmix.com/php/362009-specification-serialize.html#post1335166
The C implementation used by PHP itself is also here:
http://svn.php.net/repository/php/php-src/branches/PHP_5_2/ext/standard/var.c
http://svn.php.net/repository/php/php-src/branches/PHP_5_2/ext/standard/var_unserializer.c
However, if you are not sure if your choice serialization format will be the main bottleneck, consider using a more affordable serialization format such as JSON, XML, protocol buffers, or WDDX.
Since you are probably only serializing data, not PHP objects, you may find standardized "common ground" serialization more efficient. (JSON is probably the easiest)
Here is the same question for Java . With examples, it's pretty easy to write your own. PHP itself is written in c, and you can change the deserialize source to suit your needs.