--TEST-- Test serialize() & unserialize() functions: arrays (circular references) --INI-- serialize_precision=100 --FILE-- "test"); $arr_asso[ "b" ] = &$arr_asso[ "a" ]; var_dump($arr_asso); $serialize_data = serialize($arr_asso); var_dump($serialize_data); $arr_asso = unserialize($serialize_data); var_dump($arr_asso); echo "\nDone"; ?> --EXPECT-- --- Testing Circular reference of an array --- -- Normal array -- string(238) "a:7:{i:0;i:0;i:1;i:1;i:2;i:-2;i:3;d:3.333333000000000101437080957111902534961700439453125;i:4;s:1:"a";i:5;a:0:{}i:6;a:7:{i:0;i:0;i:1;i:1;i:2;i:-2;i:3;d:3.333333000000000101437080957111902534961700439453125;i:4;s:1:"a";i:5;a:0:{}i:6;R:8;}}" array(7) { [0]=> int(0) [1]=> int(1) [2]=> int(-2) [3]=> float(3.333333000000000101437080957111902534961700439453125) [4]=> string(1) "a" [5]=> array(0) { } [6]=> &array(7) { [0]=> int(0) [1]=> int(1) [2]=> int(-2) [3]=> float(3.333333000000000101437080957111902534961700439453125) [4]=> string(1) "a" [5]=> array(0) { } [6]=> *RECURSION* } } -- Associative array -- array(2) { ["a"]=> &string(4) "test" ["b"]=> &string(4) "test" } string(37) "a:2:{s:1:"a";s:4:"test";s:1:"b";R:2;}" array(2) { ["a"]=> &string(4) "test" ["b"]=> &string(4) "test" } Done