-
Notifications
You must be signed in to change notification settings - Fork 16
Working with Pimf_Util_Serializer
g.krsteski edited this page Jun 3, 2014
·
4 revisions
Due to PHP Bug #39736 - serialize() consumes insane amount of RAM. Now PIMF can put objects, strings, integers or arrays. Even instances of SimpleXMLElement can be put too! If igbinary a ultra-fast PHP extention compiled than PIMF uses igbinary_serialize or igbinary_unserialize. Igbinary is a drop in replacement for the standard php serializer. Instead of time and space consuming textual representation, igbinary stores php data structures in compact binary form.
Serialize
$serializedItem = \Pimf\Util\Serializer::serialize($item);
Unserialize
$item = \Pimf\Util\Serializer::unserialize($serializedItem);