PHP Classes

Recursive reference serialize: Serialize objects with cyclic references

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2009-06-01 (6 years ago) RSS 2.0 feedNot enough user ratingsTotal: 331 All time: 6,613 This week: 1,116Up
Version License PHP version Categories  
recursive-serialize 1.0The PHP License5.1PHP 5, Data types, Language
Description Author  

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: 32
All time rank: 344218 in Viet Nam Viet Nam
Week rank: 1624 Up9 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  
 0%Total:331All time:6,613
 This week:0This week:1,116Up