PHP serialize () specification

I am looking for a specification or an exact description of how the PHP serialization () function works exactly. All I could find for this topic was this comment in the manual .

Is there somewhere a more detailed description of how php implements this?

+6
source share
3 answers

To really know how PHP handles serialized strings, you would have to dig out the source code, as suggested by Pekka 웃 in the comments.

Try starting with: http://lxr.php.net/search?q=PHP_FUNCTION+serialize&project=PHP_5_4 , which provides a convenient way to search for sources.

This link comes from http://nikic.imtqy.com/2012/03/16/Understanding-PHPs-internal-function-definitions.html , which explains how to find specific function definitions in the php source.

Good luck!

+1
source

I wanted to delve into this many years ago. Warning: this blog post code is out of date. I think the spec is still accurate, but ignores the contents around it;)

http://evertpot.com/133/ Go to the "Serialized Data Format" section.

+2
source

Sadly, PHP does not provide serialization specifications.

You can study the source code https://github.com/php/php-src/blob/master/ext/standard/php_var.h , https://github.com/php/php-src/blob/master/ext /standard/var_unserializer.c . But this is hard to understand.

You may try to find implications in another language. Javascript

0
source

Source: https://habr.com/ru/post/944442/


All Articles