1--TEST--
2Bug #65481 (shutdown segfault due to serialize)
3--FILE--
4<?php
5echo "Test\n";
6
7class A {
8    public $e = array();
9}
10
11class Token implements \Serializable {
12    public function serialize()
13    {
14        $c = new A;
15
16        for ($i = 0; $i < 4; $i++)
17        {
18            $e = new A;
19            $c->e[] = $e;
20            $e->e = $c->e;
21        }
22
23        return serialize(array(serialize($c)));
24    }
25
26    public function unserialize($str)
27    {
28        $r = unserialize($str);
29        $r = unserialize($r[0]);
30    }
31}
32
33$token = new Token;
34$token = serialize($token);
35
36?>
37Done
38--EXPECT--
39Test
40Done
41