name.test 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. Invalid class name
  2. -----
  3. <?php class self {}
  4. -----
  5. Cannot use 'self' as class name as it is reserved from 1:13 to 1:16
  6. array(
  7. 0: Stmt_Class(
  8. attrGroups: array(
  9. )
  10. flags: 0
  11. name: Identifier(
  12. name: self
  13. )
  14. extends: null
  15. implements: array(
  16. )
  17. stmts: array(
  18. )
  19. )
  20. )
  21. -----
  22. <?php class PARENT {}
  23. -----
  24. Cannot use 'PARENT' as class name as it is reserved from 1:13 to 1:18
  25. array(
  26. 0: Stmt_Class(
  27. attrGroups: array(
  28. )
  29. flags: 0
  30. name: Identifier(
  31. name: PARENT
  32. )
  33. extends: null
  34. implements: array(
  35. )
  36. stmts: array(
  37. )
  38. )
  39. )
  40. -----
  41. <?php class static {}
  42. -----
  43. Syntax error, unexpected T_STATIC, expecting T_STRING from 1:13 to 1:18
  44. array(
  45. 0: Stmt_Block(
  46. stmts: array(
  47. )
  48. )
  49. )
  50. -----
  51. <?php class A extends self {}
  52. -----
  53. Cannot use 'self' as class name as it is reserved from 1:23 to 1:26
  54. array(
  55. 0: Stmt_Class(
  56. attrGroups: array(
  57. )
  58. flags: 0
  59. name: Identifier(
  60. name: A
  61. )
  62. extends: Name(
  63. name: self
  64. )
  65. implements: array(
  66. )
  67. stmts: array(
  68. )
  69. )
  70. )
  71. -----
  72. <?php class A extends PARENT {}
  73. -----
  74. Cannot use 'PARENT' as class name as it is reserved from 1:23 to 1:28
  75. array(
  76. 0: Stmt_Class(
  77. attrGroups: array(
  78. )
  79. flags: 0
  80. name: Identifier(
  81. name: A
  82. )
  83. extends: Name(
  84. name: PARENT
  85. )
  86. implements: array(
  87. )
  88. stmts: array(
  89. )
  90. )
  91. )
  92. -----
  93. <?php class A extends static {}
  94. -----
  95. Cannot use 'static' as class name as it is reserved from 1:23 to 1:28
  96. array(
  97. 0: Stmt_Class(
  98. attrGroups: array(
  99. )
  100. flags: 0
  101. name: Identifier(
  102. name: A
  103. )
  104. extends: Name(
  105. name: static
  106. )
  107. implements: array(
  108. )
  109. stmts: array(
  110. )
  111. )
  112. )
  113. -----
  114. <?php class A implements self {}
  115. -----
  116. Cannot use 'self' as interface name as it is reserved from 1:26 to 1:29
  117. array(
  118. 0: Stmt_Class(
  119. attrGroups: array(
  120. )
  121. flags: 0
  122. name: Identifier(
  123. name: A
  124. )
  125. extends: null
  126. implements: array(
  127. 0: Name(
  128. name: self
  129. )
  130. )
  131. stmts: array(
  132. )
  133. )
  134. )
  135. -----
  136. <?php class A implements PARENT {}
  137. -----
  138. Cannot use 'PARENT' as interface name as it is reserved from 1:26 to 1:31
  139. array(
  140. 0: Stmt_Class(
  141. attrGroups: array(
  142. )
  143. flags: 0
  144. name: Identifier(
  145. name: A
  146. )
  147. extends: null
  148. implements: array(
  149. 0: Name(
  150. name: PARENT
  151. )
  152. )
  153. stmts: array(
  154. )
  155. )
  156. )
  157. -----
  158. <?php class A implements static {}
  159. -----
  160. Cannot use 'static' as interface name as it is reserved from 1:26 to 1:31
  161. array(
  162. 0: Stmt_Class(
  163. attrGroups: array(
  164. )
  165. flags: 0
  166. name: Identifier(
  167. name: A
  168. )
  169. extends: null
  170. implements: array(
  171. 0: Name(
  172. name: static
  173. )
  174. )
  175. stmts: array(
  176. )
  177. )
  178. )
  179. -----
  180. <?php interface self {}
  181. -----
  182. Cannot use 'self' as class name as it is reserved from 1:17 to 1:20
  183. array(
  184. 0: Stmt_Interface(
  185. attrGroups: array(
  186. )
  187. name: Identifier(
  188. name: self
  189. )
  190. extends: array(
  191. )
  192. stmts: array(
  193. )
  194. )
  195. )
  196. -----
  197. <?php interface PARENT {}
  198. -----
  199. Cannot use 'PARENT' as class name as it is reserved from 1:17 to 1:22
  200. array(
  201. 0: Stmt_Interface(
  202. attrGroups: array(
  203. )
  204. name: Identifier(
  205. name: PARENT
  206. )
  207. extends: array(
  208. )
  209. stmts: array(
  210. )
  211. )
  212. )
  213. -----
  214. <?php interface static {}
  215. -----
  216. Syntax error, unexpected T_STATIC, expecting T_STRING from 1:17 to 1:22
  217. array(
  218. 0: Stmt_Block(
  219. stmts: array(
  220. )
  221. )
  222. )
  223. -----
  224. <?php interface A extends self {}
  225. -----
  226. Cannot use 'self' as interface name as it is reserved from 1:27 to 1:30
  227. array(
  228. 0: Stmt_Interface(
  229. attrGroups: array(
  230. )
  231. name: Identifier(
  232. name: A
  233. )
  234. extends: array(
  235. 0: Name(
  236. name: self
  237. )
  238. )
  239. stmts: array(
  240. )
  241. )
  242. )
  243. -----
  244. <?php interface A extends PARENT {}
  245. -----
  246. Cannot use 'PARENT' as interface name as it is reserved from 1:27 to 1:32
  247. array(
  248. 0: Stmt_Interface(
  249. attrGroups: array(
  250. )
  251. name: Identifier(
  252. name: A
  253. )
  254. extends: array(
  255. 0: Name(
  256. name: PARENT
  257. )
  258. )
  259. stmts: array(
  260. )
  261. )
  262. )
  263. -----
  264. <?php interface A extends static {}
  265. -----
  266. Cannot use 'static' as interface name as it is reserved from 1:27 to 1:32
  267. array(
  268. 0: Stmt_Interface(
  269. attrGroups: array(
  270. )
  271. name: Identifier(
  272. name: A
  273. )
  274. extends: array(
  275. 0: Name(
  276. name: static
  277. )
  278. )
  279. stmts: array(
  280. )
  281. )
  282. )