summaryrefslogtreecommitdiff
path: root/ext/standard/tests/serialize/bug28325.phpt
blob: 7f2bd66371128c96d36fba073dc7f115ec9aa170 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--TEST--
Bug #28325 (Problem in serialisation of circular references)
--FILE--
<?php
class a {
	public $b;
}
class b {
	public $c;
}
class c {
	public $d;
}
$a = new a();
$a->b = new b();
$a->b->c = new c();
$a->b->c->d = $a;
var_dump(unserialize(serialize($a)));
?>
--EXPECTF--
object(a)#%d (1) {
  ["b"]=>
  object(b)#%d (1) {
    ["c"]=>
    object(c)#%d (1) {
      ["d"]=>
      object(a)#%d (1) {
        ["b"]=>
        object(b)#%d (1) {
          ["c"]=>
          object(c)#%d (1) {
            ["d"]=>
            *RECURSION*
          }
        }
      }
    }
  }
}