菜谱项目

staticCall.test 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. Static calls
  2. -----
  3. <?php
  4. // method name variations
  5. A::b();
  6. A::{'b'}();
  7. A::$b();
  8. A::$b['c']();
  9. A::$b['c']['d']();
  10. // array dereferencing
  11. A::b()['c'];
  12. // class name variations
  13. static::b();
  14. $a::b();
  15. ${'a'}::b();
  16. $a['b']::c();
  17. -----
  18. !!php5
  19. array(
  20. 0: Expr_StaticCall(
  21. class: Name(
  22. parts: array(
  23. 0: A
  24. )
  25. comments: array(
  26. 0: // method name variations
  27. )
  28. )
  29. name: b
  30. args: array(
  31. )
  32. comments: array(
  33. 0: // method name variations
  34. )
  35. )
  36. 1: Expr_StaticCall(
  37. class: Name(
  38. parts: array(
  39. 0: A
  40. )
  41. )
  42. name: Scalar_String(
  43. value: b
  44. )
  45. args: array(
  46. )
  47. )
  48. 2: Expr_StaticCall(
  49. class: Name(
  50. parts: array(
  51. 0: A
  52. )
  53. )
  54. name: Expr_Variable(
  55. name: b
  56. )
  57. args: array(
  58. )
  59. )
  60. 3: Expr_StaticCall(
  61. class: Name(
  62. parts: array(
  63. 0: A
  64. )
  65. )
  66. name: Expr_ArrayDimFetch(
  67. var: Expr_Variable(
  68. name: b
  69. )
  70. dim: Scalar_String(
  71. value: c
  72. )
  73. )
  74. args: array(
  75. )
  76. )
  77. 4: Expr_StaticCall(
  78. class: Name(
  79. parts: array(
  80. 0: A
  81. )
  82. )
  83. name: Expr_ArrayDimFetch(
  84. var: Expr_ArrayDimFetch(
  85. var: Expr_Variable(
  86. name: b
  87. )
  88. dim: Scalar_String(
  89. value: c
  90. )
  91. )
  92. dim: Scalar_String(
  93. value: d
  94. )
  95. )
  96. args: array(
  97. )
  98. )
  99. 5: Expr_ArrayDimFetch(
  100. var: Expr_StaticCall(
  101. class: Name(
  102. parts: array(
  103. 0: A
  104. )
  105. comments: array(
  106. 0: // array dereferencing
  107. )
  108. )
  109. name: b
  110. args: array(
  111. )
  112. comments: array(
  113. 0: // array dereferencing
  114. )
  115. )
  116. dim: Scalar_String(
  117. value: c
  118. )
  119. comments: array(
  120. 0: // array dereferencing
  121. )
  122. )
  123. 6: Expr_StaticCall(
  124. class: Name(
  125. parts: array(
  126. 0: static
  127. )
  128. comments: array(
  129. 0: // class name variations
  130. )
  131. )
  132. name: b
  133. args: array(
  134. )
  135. comments: array(
  136. 0: // class name variations
  137. )
  138. )
  139. 7: Expr_StaticCall(
  140. class: Expr_Variable(
  141. name: a
  142. )
  143. name: b
  144. args: array(
  145. )
  146. )
  147. 8: Expr_StaticCall(
  148. class: Expr_Variable(
  149. name: Scalar_String(
  150. value: a
  151. )
  152. )
  153. name: b
  154. args: array(
  155. )
  156. )
  157. 9: Expr_StaticCall(
  158. class: Expr_ArrayDimFetch(
  159. var: Expr_Variable(
  160. name: a
  161. )
  162. dim: Scalar_String(
  163. value: b
  164. )
  165. )
  166. name: c
  167. args: array(
  168. )
  169. )
  170. )