funcCall.test 2.1 KB

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