staticMethod.test 3.9 KB

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