b2f899449a8d0e547a3cce967749aae9a43076b9
[yaffs-website] / vendor / nikic / php-parser / test / code / parser / stmt / class / simple.test
1 Class declaration
2 -----
3 <?php
4
5 class A extends B implements C, D {
6     const A = 'B', C = 'D';
7
8     public $a = 'b', $c = 'd';
9     protected $e;
10     private $f;
11
12     public function a() {}
13     public static function b($a) {}
14     public final function c() : B {}
15     protected function d() {}
16     private function e() {}
17 }
18 -----
19 array(
20     0: Stmt_Class(
21         flags: 0
22         name: A
23         extends: Name(
24             parts: array(
25                 0: B
26             )
27         )
28         implements: array(
29             0: Name(
30                 parts: array(
31                     0: C
32                 )
33             )
34             1: Name(
35                 parts: array(
36                     0: D
37                 )
38             )
39         )
40         stmts: array(
41             0: Stmt_ClassConst(
42                 flags: 0
43                 consts: array(
44                     0: Const(
45                         name: A
46                         value: Scalar_String(
47                             value: B
48                         )
49                     )
50                     1: Const(
51                         name: C
52                         value: Scalar_String(
53                             value: D
54                         )
55                     )
56                 )
57             )
58             1: Stmt_Property(
59                 flags: MODIFIER_PUBLIC (1)
60                 props: array(
61                     0: Stmt_PropertyProperty(
62                         name: a
63                         default: Scalar_String(
64                             value: b
65                         )
66                     )
67                     1: Stmt_PropertyProperty(
68                         name: c
69                         default: Scalar_String(
70                             value: d
71                         )
72                     )
73                 )
74             )
75             2: Stmt_Property(
76                 flags: MODIFIER_PROTECTED (2)
77                 props: array(
78                     0: Stmt_PropertyProperty(
79                         name: e
80                         default: null
81                     )
82                 )
83             )
84             3: Stmt_Property(
85                 flags: MODIFIER_PRIVATE (4)
86                 props: array(
87                     0: Stmt_PropertyProperty(
88                         name: f
89                         default: null
90                     )
91                 )
92             )
93             4: Stmt_ClassMethod(
94                 flags: MODIFIER_PUBLIC (1)
95                 byRef: false
96                 name: a
97                 params: array(
98                 )
99                 returnType: null
100                 stmts: array(
101                 )
102             )
103             5: Stmt_ClassMethod(
104                 flags: MODIFIER_PUBLIC | MODIFIER_STATIC (9)
105                 byRef: false
106                 name: b
107                 params: array(
108                     0: Param(
109                         type: null
110                         byRef: false
111                         variadic: false
112                         name: a
113                         default: null
114                     )
115                 )
116                 returnType: null
117                 stmts: array(
118                 )
119             )
120             6: Stmt_ClassMethod(
121                 flags: MODIFIER_PUBLIC | MODIFIER_FINAL (33)
122                 byRef: false
123                 name: c
124                 params: array(
125                 )
126                 returnType: Name(
127                     parts: array(
128                         0: B
129                     )
130                 )
131                 stmts: array(
132                 )
133             )
134             7: Stmt_ClassMethod(
135                 flags: MODIFIER_PROTECTED (2)
136                 byRef: false
137                 name: d
138                 params: array(
139                 )
140                 returnType: null
141                 stmts: array(
142                 )
143             )
144             8: Stmt_ClassMethod(
145                 flags: MODIFIER_PRIVATE (4)
146                 byRef: false
147                 name: e
148                 params: array(
149                 )
150                 returnType: null
151                 stmts: array(
152                 )
153             )
154         )
155     )
156 )