staticPropertyFetch.test 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. Static property fetches
  2. -----
  3. <?php
  4. // property name variations
  5. A::$b;
  6. A::$$b;
  7. A::${'b'};
  8. // array access
  9. A::$b['c'];
  10. A::$b{'c'};
  11. // class name variations can be found in staticCall.test
  12. -----
  13. array(
  14. 0: Stmt_Expression(
  15. expr: Expr_StaticPropertyFetch(
  16. class: Name(
  17. parts: array(
  18. 0: A
  19. )
  20. comments: array(
  21. 0: // property name variations
  22. )
  23. )
  24. name: VarLikeIdentifier(
  25. name: b
  26. )
  27. comments: array(
  28. 0: // property name variations
  29. )
  30. )
  31. comments: array(
  32. 0: // property name variations
  33. )
  34. )
  35. 1: Stmt_Expression(
  36. expr: Expr_StaticPropertyFetch(
  37. class: Name(
  38. parts: array(
  39. 0: A
  40. )
  41. )
  42. name: Expr_Variable(
  43. name: b
  44. )
  45. )
  46. )
  47. 2: Stmt_Expression(
  48. expr: Expr_StaticPropertyFetch(
  49. class: Name(
  50. parts: array(
  51. 0: A
  52. )
  53. )
  54. name: Scalar_String(
  55. value: b
  56. )
  57. )
  58. )
  59. 3: Stmt_Expression(
  60. expr: Expr_ArrayDimFetch(
  61. var: Expr_StaticPropertyFetch(
  62. class: Name(
  63. parts: array(
  64. 0: A
  65. )
  66. comments: array(
  67. 0: // array access
  68. )
  69. )
  70. name: VarLikeIdentifier(
  71. name: b
  72. )
  73. comments: array(
  74. 0: // array access
  75. )
  76. )
  77. dim: Scalar_String(
  78. value: c
  79. )
  80. comments: array(
  81. 0: // array access
  82. )
  83. )
  84. comments: array(
  85. 0: // array access
  86. )
  87. )
  88. 4: Stmt_Expression(
  89. expr: Expr_ArrayDimFetch(
  90. var: Expr_StaticPropertyFetch(
  91. class: Name(
  92. parts: array(
  93. 0: A
  94. )
  95. )
  96. name: VarLikeIdentifier(
  97. name: b
  98. )
  99. )
  100. dim: Scalar_String(
  101. value: c
  102. )
  103. )
  104. )
  105. 5: Stmt_Nop(
  106. comments: array(
  107. 0: // class name variations can be found in staticCall.test
  108. )
  109. )
  110. )