1--TEST--
2Enum unserialize refcount
3--FILE--
4<?php
5
6enum Foo {
7    case Bar;
8}
9
10debug_zval_dump(Foo::Bar);
11
12$foo = Foo::Bar;
13debug_zval_dump($foo);
14
15$bar = unserialize('E:7:"Foo:Bar";');
16debug_zval_dump($foo);
17
18unset($bar);
19debug_zval_dump($foo);
20
21unset($foo);
22debug_zval_dump(Foo::Bar);
23
24?>
25--EXPECT--
26object(Foo)#1 (1) refcount(2){
27  ["name"]=>
28  string(3) "Bar" interned
29}
30object(Foo)#1 (1) refcount(3){
31  ["name"]=>
32  string(3) "Bar" interned
33}
34object(Foo)#1 (1) refcount(4){
35  ["name"]=>
36  string(3) "Bar" interned
37}
38object(Foo)#1 (1) refcount(3){
39  ["name"]=>
40  string(3) "Bar" interned
41}
42object(Foo)#1 (1) refcount(2){
43  ["name"]=>
44  string(3) "Bar" interned
45}
46