When I do phpinfo() or php -i from the CLI, I get the following output:
session
Registered save handlers => files user sqlite memcached
Registered serializer handlers => php php_binary wddx
I was not aware that PHP serialization supported a binary format, and there does not appear to be anything in the documentation about it.
I was going to use igbinary for session serialization to a memcached server, so I'm wondering how php_binary compares.
The
igbinaryPHP extension does offer a new session serialize/deserialize handler that differs from PHP's own implementations, namelyphpandphp_binary.To answer your question: These handlers do not compare at all, they are totally different. The differences igbinary introduces are documented within the projects readme.
I assume you're asking the question because you found the word binary within the two: igbinary and php_binary. However that's not saying much. Compare the
phpwith thephp_binaryhandler first:The
php_binarysession serialize/deserialize handler is nearly identical with the defaultphphandler. They differ only how the variable names that are within the session are encoded.php_binarywill prefix all session variable names with the binary length of the name. While withphpeach variable name has a suffix of the|character (\x7C, decimal124). From what I know, the serialization of the variable's values does not differ at all.So the serialization of values is identical between the
phpandphp_binaryhandler.So next to the little difference in pre-/suffix of session variable names, the question actually asks about how does
igbinarycompare with php serialization (which is used in the session data). Those differences are outlined in theigbinaryreadme. It fairly well describes what's done and why.If you like to use
igbinaryserialization as well for serialize/unserialize, the extension offers two replacement functions:igbinary_serializeandigbinary_unserialize- used like their php cousins.If you are concerned about some specifics of the differences, please ask.