1--TEST--
2Bug #65481 (shutdown segfault due to serialize)
3--FILE--
4<?php
5
6class A {
7    public $e = array();
8}
9
10class Token implements \Serializable {
11    public function serialize()
12    {
13        $c = new A;
14
15        for ($i = 0; $i < 4; $i++)
16        {
17            $e = new A;
18            $c->e[] = $e;
19            $e->e = $c->e;
20        }
21
22        return serialize(array(serialize($c)));
23    }
24
25    public function unserialize($str)
26    {
27        $r = unserialize($str);
28        $r = unserialize($r[0]);
29    }
30}
31
32$token = new Token;
33$token = serialize($token);
34
35?>
36Done
37--EXPECTF--
38Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
39Done
40