Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP serialize() ― specification [closed]

I am searching for the specification or an exact description about how the PHP serialize() function exactly works. All I could find for that topic is that comment in the manual.

Is there anywhere out there a more detailed description about how php implements this?

like image 770
philipp Avatar asked May 07 '13 12:05

philipp


2 Answers

To truly know how PHP handles serialized strings, one would need to dig in the sourcecode as suggested by Pekka 웃 in the comments.

Try starting at: http://lxr.php.net/search?q=PHP_FUNCTION+serialize&project=PHP_5_4 which gives a convenient way to search the sources.

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

Goodluck!

like image 36
Damien Overeem Avatar answered Oct 16 '22 09:10

Damien Overeem


I wanted to dig into this years ago. Warning: this blogpost is way old. I think the spec is still accurate, but ignore the content around it ;)

http://evertpot.com/133/ Jump to the section titled: The serialized data format.

like image 178
Evert Avatar answered Oct 16 '22 10:10

Evert