1--TEST--
2Enum in SplObjectStorage
3--FILE--
4<?php
5
6enum Foo {
7    case Bar;
8    case Baz;
9    case Qux;
10}
11
12$storage = new SplObjectStorage();
13$storage[Foo::Bar] = 'Bar';
14$storage[Foo::Baz] = 'Baz';
15
16var_dump($storage[Foo::Bar]);
17var_dump($storage[Foo::Baz]);
18
19var_dump($storage->contains(Foo::Bar));
20var_dump($storage->contains(Foo::Qux));
21
22$serialized = serialize($storage);
23var_dump($serialized);
24
25$unserialized = unserialize($serialized);
26var_dump($unserialized[Foo::Bar]);
27var_dump($unserialized[Foo::Baz]);
28
29?>
30--EXPECT--
31string(3) "Bar"
32string(3) "Baz"
33bool(true)
34bool(false)
35string(112) "O:16:"SplObjectStorage":2:{i:0;a:4:{i:0;E:7:"Foo:Bar";i:1;s:3:"Bar";i:2;E:7:"Foo:Baz";i:3;s:3:"Baz";}i:1;a:0:{}}"
36string(3) "Bar"
37string(3) "Baz"
38