closure.test 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Closures
  2. -----
  3. <?php
  4. function($a) { $a; };
  5. function($a) use($b) {};
  6. function() use($a, &$b) {};
  7. function &($a) {};
  8. static function() {};
  9. -----
  10. array(
  11. 0: Expr_Closure(
  12. static: false
  13. byRef: false
  14. params: array(
  15. 0: Param(
  16. name: a
  17. default: null
  18. type: null
  19. byRef: false
  20. )
  21. )
  22. uses: array(
  23. )
  24. stmts: array(
  25. 0: Expr_Variable(
  26. name: a
  27. )
  28. )
  29. )
  30. 1: Expr_Closure(
  31. static: false
  32. byRef: false
  33. params: array(
  34. 0: Param(
  35. name: a
  36. default: null
  37. type: null
  38. byRef: false
  39. )
  40. )
  41. uses: array(
  42. 0: Expr_ClosureUse(
  43. var: b
  44. byRef: false
  45. )
  46. )
  47. stmts: array(
  48. )
  49. )
  50. 2: Expr_Closure(
  51. static: false
  52. byRef: false
  53. params: array(
  54. )
  55. uses: array(
  56. 0: Expr_ClosureUse(
  57. var: a
  58. byRef: false
  59. )
  60. 1: Expr_ClosureUse(
  61. var: b
  62. byRef: true
  63. )
  64. )
  65. stmts: array(
  66. )
  67. )
  68. 3: Expr_Closure(
  69. static: false
  70. byRef: true
  71. params: array(
  72. 0: Param(
  73. name: a
  74. default: null
  75. type: null
  76. byRef: false
  77. )
  78. )
  79. uses: array(
  80. )
  81. stmts: array(
  82. )
  83. )
  84. 4: Expr_Closure(
  85. static: true
  86. byRef: false
  87. params: array(
  88. )
  89. uses: array(
  90. )
  91. stmts: array(
  92. )
  93. )
  94. )