PHP compatible serialization from C / C ++

Does anyone know a library that allows serialization of data in C ++ so that it can be deserialized using the "unserialize" function by default?

+6
php
source share
3 answers

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.

+5
source share

Since you are probably only serializing data, not PHP objects, you may find standardized "common ground" serialization more efficient. (JSON is probably the easiest)

+2
source share

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.

0
source share

All Articles