Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / test / code / parser / stmt / namespace / mix.test
1 Namespace types cannot be mixed
2 -----
3 <?php
4 namespace A;
5 echo 1;
6 namespace B {
7     echo 2;
8 }
9 echo 3;
10 -----
11 Cannot mix bracketed namespace declarations with unbracketed namespace declarations on line 4
12 array(
13     0: Stmt_Namespace(
14         name: Name(
15             parts: array(
16                 0: A
17             )
18         )
19         stmts: array(
20             0: Stmt_Echo(
21                 exprs: array(
22                     0: Scalar_LNumber(
23                         value: 1
24                     )
25                 )
26             )
27         )
28     )
29     1: Stmt_Namespace(
30         name: Name(
31             parts: array(
32                 0: B
33             )
34         )
35         stmts: array(
36             0: Stmt_Echo(
37                 exprs: array(
38                     0: Scalar_LNumber(
39                         value: 2
40                     )
41                 )
42             )
43         )
44     )
45     2: Stmt_Echo(
46         exprs: array(
47             0: Scalar_LNumber(
48                 value: 3
49             )
50         )
51     )
52 )
53 -----
54 <?php
55 namespace A {
56     echo 1;
57 }
58 echo 2;
59 namespace B;
60 echo 3;
61 -----
62 Cannot mix bracketed namespace declarations with unbracketed namespace declarations on line 6
63 array(
64     0: Stmt_Namespace(
65         name: Name(
66             parts: array(
67                 0: A
68             )
69         )
70         stmts: array(
71             0: Stmt_Echo(
72                 exprs: array(
73                     0: Scalar_LNumber(
74                         value: 1
75                     )
76                 )
77             )
78         )
79     )
80     1: Stmt_Echo(
81         exprs: array(
82             0: Scalar_LNumber(
83                 value: 2
84             )
85         )
86     )
87     2: Stmt_Namespace(
88         name: Name(
89             parts: array(
90                 0: B
91             )
92         )
93         stmts: array(
94             0: Stmt_Echo(
95                 exprs: array(
96                     0: Scalar_LNumber(
97                         value: 3
98                     )
99                 )
100             )
101         )
102     )
103 )