staticMethod.test 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. )