Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / test / code / parser / stmt / namespace / alias.test
1 Aliases (use)
2 -----
3 <?php
4
5 use A\B;
6 use C\D as E;
7 use F\G as H, J;
8
9 // evil alias notation - Do Not Use!
10 use \A;
11 use \A as B;
12
13 // function and constant aliases
14 use function foo\bar;
15 use function foo\bar as baz;
16 use const foo\BAR;
17 use const foo\BAR as BAZ;
18 -----
19 array(
20     0: Stmt_Use(
21         type: TYPE_NORMAL (1)
22         uses: array(
23             0: Stmt_UseUse(
24                 type: TYPE_UNKNOWN (0)
25                 name: Name(
26                     parts: array(
27                         0: A
28                         1: B
29                     )
30                 )
31                 alias: B
32             )
33         )
34     )
35     1: Stmt_Use(
36         type: TYPE_NORMAL (1)
37         uses: array(
38             0: Stmt_UseUse(
39                 type: TYPE_UNKNOWN (0)
40                 name: Name(
41                     parts: array(
42                         0: C
43                         1: D
44                     )
45                 )
46                 alias: E
47             )
48         )
49     )
50     2: Stmt_Use(
51         type: TYPE_NORMAL (1)
52         uses: array(
53             0: Stmt_UseUse(
54                 type: TYPE_UNKNOWN (0)
55                 name: Name(
56                     parts: array(
57                         0: F
58                         1: G
59                     )
60                 )
61                 alias: H
62             )
63             1: Stmt_UseUse(
64                 type: TYPE_UNKNOWN (0)
65                 name: Name(
66                     parts: array(
67                         0: J
68                     )
69                 )
70                 alias: J
71             )
72         )
73     )
74     3: Stmt_Use(
75         type: TYPE_NORMAL (1)
76         uses: array(
77             0: Stmt_UseUse(
78                 type: TYPE_UNKNOWN (0)
79                 name: Name(
80                     parts: array(
81                         0: A
82                     )
83                 )
84                 alias: A
85             )
86         )
87         comments: array(
88             0: // evil alias notation - Do Not Use!
89         )
90     )
91     4: Stmt_Use(
92         type: TYPE_NORMAL (1)
93         uses: array(
94             0: Stmt_UseUse(
95                 type: TYPE_UNKNOWN (0)
96                 name: Name(
97                     parts: array(
98                         0: A
99                     )
100                 )
101                 alias: B
102             )
103         )
104     )
105     5: Stmt_Use(
106         type: TYPE_FUNCTION (2)
107         uses: array(
108             0: Stmt_UseUse(
109                 type: TYPE_UNKNOWN (0)
110                 name: Name(
111                     parts: array(
112                         0: foo
113                         1: bar
114                     )
115                 )
116                 alias: bar
117             )
118         )
119         comments: array(
120             0: // function and constant aliases
121         )
122     )
123     6: Stmt_Use(
124         type: TYPE_FUNCTION (2)
125         uses: array(
126             0: Stmt_UseUse(
127                 type: TYPE_UNKNOWN (0)
128                 name: Name(
129                     parts: array(
130                         0: foo
131                         1: bar
132                     )
133                 )
134                 alias: baz
135             )
136         )
137     )
138     7: Stmt_Use(
139         type: TYPE_CONSTANT (3)
140         uses: array(
141             0: Stmt_UseUse(
142                 type: TYPE_UNKNOWN (0)
143                 name: Name(
144                     parts: array(
145                         0: foo
146                         1: BAR
147                     )
148                 )
149                 alias: BAR
150             )
151         )
152     )
153     8: Stmt_Use(
154         type: TYPE_CONSTANT (3)
155         uses: array(
156             0: Stmt_UseUse(
157                 type: TYPE_UNKNOWN (0)
158                 name: Name(
159                     parts: array(
160                         0: foo
161                         1: BAR
162                     )
163                 )
164                 alias: BAZ
165             )
166         )
167     )
168 )