菜谱项目

alias.test 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. Aliases (use)
  2. -----
  3. <?php
  4. use A\B;
  5. use C\D as E;
  6. use F\G as H, J;
  7. // evil alias notation - Do Not Use!
  8. use \A;
  9. use \A as B;
  10. // function and constant aliases
  11. use function foo\bar;
  12. use function foo\bar as baz;
  13. use const foo\BAR;
  14. use const foo\BAR as BAZ;
  15. -----
  16. array(
  17. 0: Stmt_Use(
  18. type: TYPE_NORMAL (1)
  19. uses: array(
  20. 0: Stmt_UseUse(
  21. type: TYPE_UNKNOWN (0)
  22. name: Name(
  23. parts: array(
  24. 0: A
  25. 1: B
  26. )
  27. )
  28. alias: B
  29. )
  30. )
  31. )
  32. 1: Stmt_Use(
  33. type: TYPE_NORMAL (1)
  34. uses: array(
  35. 0: Stmt_UseUse(
  36. type: TYPE_UNKNOWN (0)
  37. name: Name(
  38. parts: array(
  39. 0: C
  40. 1: D
  41. )
  42. )
  43. alias: E
  44. )
  45. )
  46. )
  47. 2: Stmt_Use(
  48. type: TYPE_NORMAL (1)
  49. uses: array(
  50. 0: Stmt_UseUse(
  51. type: TYPE_UNKNOWN (0)
  52. name: Name(
  53. parts: array(
  54. 0: F
  55. 1: G
  56. )
  57. )
  58. alias: H
  59. )
  60. 1: Stmt_UseUse(
  61. type: TYPE_UNKNOWN (0)
  62. name: Name(
  63. parts: array(
  64. 0: J
  65. )
  66. )
  67. alias: J
  68. )
  69. )
  70. )
  71. 3: Stmt_Use(
  72. type: TYPE_NORMAL (1)
  73. uses: array(
  74. 0: Stmt_UseUse(
  75. type: TYPE_UNKNOWN (0)
  76. name: Name(
  77. parts: array(
  78. 0: A
  79. )
  80. )
  81. alias: A
  82. )
  83. )
  84. comments: array(
  85. 0: // evil alias notation - Do Not Use!
  86. )
  87. )
  88. 4: Stmt_Use(
  89. type: TYPE_NORMAL (1)
  90. uses: array(
  91. 0: Stmt_UseUse(
  92. type: TYPE_UNKNOWN (0)
  93. name: Name(
  94. parts: array(
  95. 0: A
  96. )
  97. )
  98. alias: B
  99. )
  100. )
  101. )
  102. 5: Stmt_Use(
  103. type: TYPE_FUNCTION (2)
  104. uses: array(
  105. 0: Stmt_UseUse(
  106. type: TYPE_UNKNOWN (0)
  107. name: Name(
  108. parts: array(
  109. 0: foo
  110. 1: bar
  111. )
  112. )
  113. alias: bar
  114. )
  115. )
  116. comments: array(
  117. 0: // function and constant aliases
  118. )
  119. )
  120. 6: Stmt_Use(
  121. type: TYPE_FUNCTION (2)
  122. uses: array(
  123. 0: Stmt_UseUse(
  124. type: TYPE_UNKNOWN (0)
  125. name: Name(
  126. parts: array(
  127. 0: foo
  128. 1: bar
  129. )
  130. )
  131. alias: baz
  132. )
  133. )
  134. )
  135. 7: Stmt_Use(
  136. type: TYPE_CONSTANT (3)
  137. uses: array(
  138. 0: Stmt_UseUse(
  139. type: TYPE_UNKNOWN (0)
  140. name: Name(
  141. parts: array(
  142. 0: foo
  143. 1: BAR
  144. )
  145. )
  146. alias: BAR
  147. )
  148. )
  149. )
  150. 8: Stmt_Use(
  151. type: TYPE_CONSTANT (3)
  152. uses: array(
  153. 0: Stmt_UseUse(
  154. type: TYPE_UNKNOWN (0)
  155. name: Name(
  156. parts: array(
  157. 0: foo
  158. 1: BAR
  159. )
  160. )
  161. alias: BAZ
  162. )
  163. )
  164. )
  165. )