简体   繁体   中英

PHP compatible serialization from C/C++

有人知道一个库允许数据在C ++中序列化,以便可以使用默认的PHP'unserialize'函数对其进行反序列化吗?

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, unless you're absolutely certain that your choice serialization format is going to be a major bottleneck, consider using a more readily available serialization format, like JSON, XML, Protocol Buffers, or WDDX.

Since you're probably only serializing data, and not PHP objects, you may find a standardized "common ground" serialization more effective. (JSON is likely the simplest)

Here is the same question for Java . It should be pretty easy to write your own with examples. PHP its self is written in c and you could modify the deserialize source to your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM