staticMethod.test 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. attrGroups: array(
  9. )
  10. flags: 0
  11. name: Identifier(
  12. name: A
  13. )
  14. extends: null
  15. implements: array(
  16. )
  17. stmts: array(
  18. 0: Stmt_ClassMethod(
  19. attrGroups: array(
  20. )
  21. flags: MODIFIER_STATIC (8)
  22. byRef: false
  23. name: Identifier(
  24. name: __construct
  25. )
  26. params: array(
  27. )
  28. returnType: null
  29. stmts: array(
  30. )
  31. )
  32. )
  33. )
  34. )
  35. -----
  36. <?php class A { static function __destruct() {} }
  37. -----
  38. Destructor __destruct() cannot be static from 1:17 to 1:22
  39. array(
  40. 0: Stmt_Class(
  41. attrGroups: array(
  42. )
  43. flags: 0
  44. name: Identifier(
  45. name: A
  46. )
  47. extends: null
  48. implements: array(
  49. )
  50. stmts: array(
  51. 0: Stmt_ClassMethod(
  52. attrGroups: array(
  53. )
  54. flags: MODIFIER_STATIC (8)
  55. byRef: false
  56. name: Identifier(
  57. name: __destruct
  58. )
  59. params: array(
  60. )
  61. returnType: null
  62. stmts: array(
  63. )
  64. )
  65. )
  66. )
  67. )
  68. -----
  69. <?php class A { static function __clone() {} }
  70. -----
  71. Clone method __clone() cannot be static from 1:17 to 1:22
  72. array(
  73. 0: Stmt_Class(
  74. attrGroups: array(
  75. )
  76. flags: 0
  77. name: Identifier(
  78. name: A
  79. )
  80. extends: null
  81. implements: array(
  82. )
  83. stmts: array(
  84. 0: Stmt_ClassMethod(
  85. attrGroups: array(
  86. )
  87. flags: MODIFIER_STATIC (8)
  88. byRef: false
  89. name: Identifier(
  90. name: __clone
  91. )
  92. params: array(
  93. )
  94. returnType: null
  95. stmts: array(
  96. )
  97. )
  98. )
  99. )
  100. )
  101. -----
  102. <?php class A { static function __CONSTRUCT() {} }
  103. -----
  104. Constructor __CONSTRUCT() cannot be static from 1:17 to 1:22
  105. array(
  106. 0: Stmt_Class(
  107. attrGroups: array(
  108. )
  109. flags: 0
  110. name: Identifier(
  111. name: A
  112. )
  113. extends: null
  114. implements: array(
  115. )
  116. stmts: array(
  117. 0: Stmt_ClassMethod(
  118. attrGroups: array(
  119. )
  120. flags: MODIFIER_STATIC (8)
  121. byRef: false
  122. name: Identifier(
  123. name: __CONSTRUCT
  124. )
  125. params: array(
  126. )
  127. returnType: null
  128. stmts: array(
  129. )
  130. )
  131. )
  132. )
  133. )
  134. -----
  135. <?php class A { static function __Destruct() {} }
  136. -----
  137. Destructor __Destruct() cannot be static from 1:17 to 1:22
  138. array(
  139. 0: Stmt_Class(
  140. attrGroups: array(
  141. )
  142. flags: 0
  143. name: Identifier(
  144. name: A
  145. )
  146. extends: null
  147. implements: array(
  148. )
  149. stmts: array(
  150. 0: Stmt_ClassMethod(
  151. attrGroups: array(
  152. )
  153. flags: MODIFIER_STATIC (8)
  154. byRef: false
  155. name: Identifier(
  156. name: __Destruct
  157. )
  158. params: array(
  159. )
  160. returnType: null
  161. stmts: array(
  162. )
  163. )
  164. )
  165. )
  166. )
  167. -----
  168. <?php class A { static function __cLoNe() {} }
  169. -----
  170. Clone method __cLoNe() cannot be static from 1:17 to 1:22
  171. array(
  172. 0: Stmt_Class(
  173. attrGroups: array(
  174. )
  175. flags: 0
  176. name: Identifier(
  177. name: A
  178. )
  179. extends: null
  180. implements: array(
  181. )
  182. stmts: array(
  183. 0: Stmt_ClassMethod(
  184. attrGroups: array(
  185. )
  186. flags: MODIFIER_STATIC (8)
  187. byRef: false
  188. name: Identifier(
  189. name: __cLoNe
  190. )
  191. params: array(
  192. )
  193. returnType: null
  194. stmts: array(
  195. )
  196. )
  197. )
  198. )
  199. )