comparison vendor/nikic/php-parser/test/code/parser/stmt/class/staticMethod.test @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 5fb285c0d0e3
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 Some special methods cannot be static
2 -----
3 <?php class A { static function __construct() {} }
4 -----
5 Constructor __construct() cannot be static from 1:17 to 1:22
6 array(
7 0: Stmt_Class(
8 flags: 0
9 name: A
10 extends: null
11 implements: array(
12 )
13 stmts: array(
14 0: Stmt_ClassMethod(
15 flags: MODIFIER_STATIC (8)
16 byRef: false
17 name: __construct
18 params: array(
19 )
20 returnType: null
21 stmts: array(
22 )
23 )
24 )
25 )
26 )
27 -----
28 <?php class A { static function __destruct() {} }
29 -----
30 Destructor __destruct() cannot be static from 1:17 to 1:22
31 array(
32 0: Stmt_Class(
33 flags: 0
34 name: A
35 extends: null
36 implements: array(
37 )
38 stmts: array(
39 0: Stmt_ClassMethod(
40 flags: MODIFIER_STATIC (8)
41 byRef: false
42 name: __destruct
43 params: array(
44 )
45 returnType: null
46 stmts: array(
47 )
48 )
49 )
50 )
51 )
52 -----
53 <?php class A { static function __clone() {} }
54 -----
55 Clone method __clone() cannot be static from 1:17 to 1:22
56 array(
57 0: Stmt_Class(
58 flags: 0
59 name: A
60 extends: null
61 implements: array(
62 )
63 stmts: array(
64 0: Stmt_ClassMethod(
65 flags: MODIFIER_STATIC (8)
66 byRef: false
67 name: __clone
68 params: array(
69 )
70 returnType: null
71 stmts: array(
72 )
73 )
74 )
75 )
76 )
77 -----
78 <?php class A { static function __CONSTRUCT() {} }
79 -----
80 Constructor __CONSTRUCT() cannot be static from 1:17 to 1:22
81 array(
82 0: Stmt_Class(
83 flags: 0
84 name: A
85 extends: null
86 implements: array(
87 )
88 stmts: array(
89 0: Stmt_ClassMethod(
90 flags: MODIFIER_STATIC (8)
91 byRef: false
92 name: __CONSTRUCT
93 params: array(
94 )
95 returnType: null
96 stmts: array(
97 )
98 )
99 )
100 )
101 )
102 -----
103 <?php class A { static function __Destruct() {} }
104 -----
105 Destructor __Destruct() cannot be static from 1:17 to 1:22
106 array(
107 0: Stmt_Class(
108 flags: 0
109 name: A
110 extends: null
111 implements: array(
112 )
113 stmts: array(
114 0: Stmt_ClassMethod(
115 flags: MODIFIER_STATIC (8)
116 byRef: false
117 name: __Destruct
118 params: array(
119 )
120 returnType: null
121 stmts: array(
122 )
123 )
124 )
125 )
126 )
127 -----
128 <?php class A { static function __cLoNe() {} }
129 -----
130 Clone method __cLoNe() cannot be static from 1:17 to 1:22
131 array(
132 0: Stmt_Class(
133 flags: 0
134 name: A
135 extends: null
136 implements: array(
137 )
138 stmts: array(
139 0: Stmt_ClassMethod(
140 flags: MODIFIER_STATIC (8)
141 byRef: false
142 name: __cLoNe
143 params: array(
144 )
145 returnType: null
146 stmts: array(
147 )
148 )
149 )
150 )
151 )