PHP Classes

File: manuscript/Working with Pimf_Util_Serializer.md

Recommend this page to a friend!
  Classes of Gjero Krsteski   PIMF   manuscript/Working with Pimf_Util_Serializer.md   Download  
File: manuscript/Working with Pimf_Util_Serializer.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PIMF
Framework for Web application development
Author: By
Last change: Update of manuscript/Working with Pimf_Util_Serializer.md
Date: 5 months ago
Size: 662 bytes
 

Contents

Class file image Download

Serializer

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);