Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / test / code / parser / expr / uvs / new.test
1 UVS new expressions
2 -----
3 <?php
4 new $className;
5 new $array['className'];
6 new $array{'className'};
7 new $obj->className;
8 new Test::$className;
9 new $test::$className;
10 new $weird[0]->foo::$className;
11 -----
12 !!php7
13 array(
14     0: Expr_New(
15         class: Expr_Variable(
16             name: className
17         )
18         args: array(
19         )
20     )
21     1: Expr_New(
22         class: Expr_ArrayDimFetch(
23             var: Expr_Variable(
24                 name: array
25             )
26             dim: Scalar_String(
27                 value: className
28             )
29         )
30         args: array(
31         )
32     )
33     2: Expr_New(
34         class: Expr_ArrayDimFetch(
35             var: Expr_Variable(
36                 name: array
37             )
38             dim: Scalar_String(
39                 value: className
40             )
41         )
42         args: array(
43         )
44     )
45     3: Expr_New(
46         class: Expr_PropertyFetch(
47             var: Expr_Variable(
48                 name: obj
49             )
50             name: className
51         )
52         args: array(
53         )
54     )
55     4: Expr_New(
56         class: Expr_StaticPropertyFetch(
57             class: Name(
58                 parts: array(
59                     0: Test
60                 )
61             )
62             name: className
63         )
64         args: array(
65         )
66     )
67     5: Expr_New(
68         class: Expr_StaticPropertyFetch(
69             class: Expr_Variable(
70                 name: test
71             )
72             name: className
73         )
74         args: array(
75         )
76     )
77     6: Expr_New(
78         class: Expr_StaticPropertyFetch(
79             class: Expr_PropertyFetch(
80                 var: Expr_ArrayDimFetch(
81                     var: Expr_Variable(
82                         name: weird
83                     )
84                     dim: Scalar_LNumber(
85                         value: 0
86                     )
87                 )
88                 name: foo
89             )
90             name: className
91         )
92         args: array(
93         )
94     )
95 )