xref: /PHP-Parser/test/code/parser/stmt/class/enum.test (revision 23647573)
1Enum
2-----
3<?php
4
5enum A {
6    case class;
7}
8enum B implements Bar, Baz {
9}
10enum C: int implements Bar {
11    case Foo = 1;
12}
13-----
14array(
15    0: Stmt_Enum(
16        attrGroups: array(
17        )
18        name: Identifier(
19            name: A
20        )
21        scalarType: null
22        implements: array(
23        )
24        stmts: array(
25            0: Stmt_EnumCase(
26                attrGroups: array(
27                )
28                name: Identifier(
29                    name: class
30                )
31                expr: null
32            )
33        )
34    )
35    1: Stmt_Enum(
36        attrGroups: array(
37        )
38        name: Identifier(
39            name: B
40        )
41        scalarType: null
42        implements: array(
43            0: Name(
44                name: Bar
45            )
46            1: Name(
47                name: Baz
48            )
49        )
50        stmts: array(
51        )
52    )
53    2: Stmt_Enum(
54        attrGroups: array(
55        )
56        name: Identifier(
57            name: C
58        )
59        scalarType: Identifier(
60            name: int
61        )
62        implements: array(
63            0: Name(
64                name: Bar
65            )
66        )
67        stmts: array(
68            0: Stmt_EnumCase(
69                attrGroups: array(
70                )
71                name: Identifier(
72                    name: Foo
73                )
74                expr: Scalar_Int(
75                    value: 1
76                )
77            )
78        )
79    )
80)
81