1--TEST--
2Enum must not implement Serializable indirectly
3--FILE--
4<?php
5
6interface MySerializable extends Serializable {}
7
8enum Foo implements MySerializable {
9    case Bar;
10
11    public function serialize() {
12        return serialize('Hello');
13    }
14
15    public function unserialize($data) {
16        return unserialize($data);
17    }
18}
19
20var_dump(unserialize(serialize(Foo::Bar)));
21
22?>
23--EXPECTF--
24Deprecated: %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
25
26Fatal error: Enum Foo cannot implement the Serializable interface in %s on line %d
27