staticCall.test 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. array(
  19. 0: Expr_StaticCall(
  20. class: Name(
  21. parts: array(
  22. 0: A
  23. )
  24. )
  25. name: b
  26. args: array(
  27. )
  28. )
  29. 1: Expr_StaticCall(
  30. class: Name(
  31. parts: array(
  32. 0: A
  33. )
  34. )
  35. name: Scalar_String(
  36. value: b
  37. )
  38. args: array(
  39. )
  40. )
  41. 2: Expr_StaticCall(
  42. class: Name(
  43. parts: array(
  44. 0: A
  45. )
  46. )
  47. name: Expr_Variable(
  48. name: b
  49. )
  50. args: array(
  51. )
  52. )
  53. 3: Expr_StaticCall(
  54. class: Name(
  55. parts: array(
  56. 0: A
  57. )
  58. )
  59. name: Expr_ArrayDimFetch(
  60. var: Expr_Variable(
  61. name: b
  62. )
  63. dim: Scalar_String(
  64. value: c
  65. )
  66. )
  67. args: array(
  68. )
  69. )
  70. 4: Expr_StaticCall(
  71. class: Name(
  72. parts: array(
  73. 0: A
  74. )
  75. )
  76. name: Expr_ArrayDimFetch(
  77. var: Expr_ArrayDimFetch(
  78. var: Expr_Variable(
  79. name: b
  80. )
  81. dim: Scalar_String(
  82. value: c
  83. )
  84. )
  85. dim: Scalar_String(
  86. value: d
  87. )
  88. )
  89. args: array(
  90. )
  91. )
  92. 5: Expr_ArrayDimFetch(
  93. var: Expr_StaticCall(
  94. class: Name(
  95. parts: array(
  96. 0: A
  97. )
  98. )
  99. name: b
  100. args: array(
  101. )
  102. )
  103. dim: Scalar_String(
  104. value: c
  105. )
  106. )
  107. 6: Expr_StaticCall(
  108. class: Name(
  109. parts: array(
  110. 0: static
  111. )
  112. )
  113. name: b
  114. args: array(
  115. )
  116. )
  117. 7: Expr_StaticCall(
  118. class: Expr_Variable(
  119. name: a
  120. )
  121. name: b
  122. args: array(
  123. )
  124. )
  125. 8: Expr_StaticCall(
  126. class: Expr_Variable(
  127. name: Scalar_String(
  128. value: a
  129. )
  130. )
  131. name: b
  132. args: array(
  133. )
  134. )
  135. 9: Expr_StaticCall(
  136. class: Expr_ArrayDimFetch(
  137. var: Expr_Variable(
  138. name: a
  139. )
  140. dim: Scalar_String(
  141. value: b
  142. )
  143. )
  144. name: c
  145. args: array(
  146. )
  147. )
  148. )