菜谱项目

variadic.test 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. Variadic functions
  2. -----
  3. <?php
  4. function test($a, ... $b) {}
  5. function test($a, &... $b) {}
  6. function test($a, Type ... $b) {}
  7. function test($a, Type &... $b) {}
  8. -----
  9. array(
  10. 0: Stmt_Function(
  11. byRef: false
  12. name: test
  13. params: array(
  14. 0: Param(
  15. type: null
  16. byRef: false
  17. variadic: false
  18. name: a
  19. default: null
  20. )
  21. 1: Param(
  22. type: null
  23. byRef: false
  24. variadic: true
  25. name: b
  26. default: null
  27. )
  28. )
  29. returnType: null
  30. stmts: array(
  31. )
  32. )
  33. 1: Stmt_Function(
  34. byRef: false
  35. name: test
  36. params: array(
  37. 0: Param(
  38. type: null
  39. byRef: false
  40. variadic: false
  41. name: a
  42. default: null
  43. )
  44. 1: Param(
  45. type: null
  46. byRef: true
  47. variadic: true
  48. name: b
  49. default: null
  50. )
  51. )
  52. returnType: null
  53. stmts: array(
  54. )
  55. )
  56. 2: Stmt_Function(
  57. byRef: false
  58. name: test
  59. params: array(
  60. 0: Param(
  61. type: null
  62. byRef: false
  63. variadic: false
  64. name: a
  65. default: null
  66. )
  67. 1: Param(
  68. type: Name(
  69. parts: array(
  70. 0: Type
  71. )
  72. )
  73. byRef: false
  74. variadic: true
  75. name: b
  76. default: null
  77. )
  78. )
  79. returnType: null
  80. stmts: array(
  81. )
  82. )
  83. 3: Stmt_Function(
  84. byRef: false
  85. name: test
  86. params: array(
  87. 0: Param(
  88. type: null
  89. byRef: false
  90. variadic: false
  91. name: a
  92. default: null
  93. )
  94. 1: Param(
  95. type: Name(
  96. parts: array(
  97. 0: Type
  98. )
  99. )
  100. byRef: true
  101. variadic: true
  102. name: b
  103. default: null
  104. )
  105. )
  106. returnType: null
  107. stmts: array(
  108. )
  109. )
  110. )