serialize() in C++ ?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I use a PHP based blog system and am considering writing some offline

Does anyone know of a C++ class or function which can un/serialze()
data compatibly with PHP ?

Thanks in advance...

Re: serialize() in C++ ? wrote:

Quoted text here. Click to load it


I am quite unexperienced with C++, but can the PHP sourcefiles help you?

Download them at

You'll find files like this:


They contain a lot of C-code that might be of help. :-)

Here is a small piece.
They all start with including other files, you maybe you have puzzle a bit  
to satify dependencies...
Maybe not. What do I know of C?  

Erwin Moller


/* $Id: var_unserializer.c,v 2005/03/10 01:58:13 helly Exp $ */

#include "php.h"
#include "ext/standard/php_var.h"
#include "php_incomplete_class.h"

/* {{{ reference-handling for unserializer: var_* */
#define VAR_ENTRIES_MAX 1024

typedef struct {
        zval *data[VAR_ENTRIES_MAX];
        long used_slots;
        void *next;
} var_entries;

static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval)


Site Timeline