PHP Classes

Recursive reference serialize: Serialize objects with cyclic references

Recommend this page to a friend!
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 32%Total: 345 All time: 7,039 This week: 660Up
Version License PHP version Categories
recursive-serialize 1.0The PHP License5.1PHP 5, Data types, Language


This class can be used to serialize objects with cyclic references.

It can take an object value and generate a string that represents the information contained in the object.

The class can also do the opposite, i.e. process a string with an object representation and recreate the original object value.

The class takes care of cyclic object references, i.e. objects that reference other objects and those objects contain references back to the original objects.

It uses object keys to represent object values and detect cyclic references.

Innovation Award
PHP Programming Innovation award nominee
May 2009
Number 3

Prize: One book of choice by Manning
PHP serialize function can generate a string that may represent complex data structures, including those that may contain object references.

However, it cannot handle the situation of objects that reference each other in a cycle.

This class provides a practical workaround that can serialize and unserialize objects with cyclic references.

Manuel Lemos
Picture of nghia nguyen
Name: nghia nguyen <contact>
Classes: 1 package by
Country: Viet Nam Viet Nam
Age: 41
All time rank: 371319 in Viet Nam Viet Nam
Week rank: 259 Up2 in Viet Nam Viet Nam Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file post-serialize-by-manager.php Example post serialize by manager helper
Accessible without login Plain text file serialize-example.php Example serialize example
Accessible without login Plain text file serialize-object-by-manager.php Example serialize object by manager helper
Plain text file SerializeManager.php Class Serialize Manager
Plain text file TSClass1.php Class TSClass1 implement demo
Accessible without login Plain text file unserialize-object-by-manager.php Example unserialize object by manager helper

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,039
This week:660Up
 User Ratings  
 All time