constModifiers.test 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. Class constant modifiers
  2. -----
  3. <?php
  4. class Foo {
  5. const A = 1;
  6. public const B = 2;
  7. protected const C = 3;
  8. private const D = 4;
  9. final const E = 5;
  10. }
  11. -----
  12. array(
  13. 0: Stmt_Class(
  14. attrGroups: array(
  15. )
  16. flags: 0
  17. name: Identifier(
  18. name: Foo
  19. )
  20. extends: null
  21. implements: array(
  22. )
  23. stmts: array(
  24. 0: Stmt_ClassConst(
  25. attrGroups: array(
  26. )
  27. flags: 0
  28. type: null
  29. consts: array(
  30. 0: Const(
  31. name: Identifier(
  32. name: A
  33. )
  34. value: Scalar_Int(
  35. value: 1
  36. )
  37. )
  38. )
  39. )
  40. 1: Stmt_ClassConst(
  41. attrGroups: array(
  42. )
  43. flags: PUBLIC (1)
  44. type: null
  45. consts: array(
  46. 0: Const(
  47. name: Identifier(
  48. name: B
  49. )
  50. value: Scalar_Int(
  51. value: 2
  52. )
  53. )
  54. )
  55. )
  56. 2: Stmt_ClassConst(
  57. attrGroups: array(
  58. )
  59. flags: PROTECTED (2)
  60. type: null
  61. consts: array(
  62. 0: Const(
  63. name: Identifier(
  64. name: C
  65. )
  66. value: Scalar_Int(
  67. value: 3
  68. )
  69. )
  70. )
  71. )
  72. 3: Stmt_ClassConst(
  73. attrGroups: array(
  74. )
  75. flags: PRIVATE (4)
  76. type: null
  77. consts: array(
  78. 0: Const(
  79. name: Identifier(
  80. name: D
  81. )
  82. value: Scalar_Int(
  83. value: 4
  84. )
  85. )
  86. )
  87. )
  88. 4: Stmt_ClassConst(
  89. attrGroups: array(
  90. )
  91. flags: FINAL (32)
  92. type: null
  93. consts: array(
  94. 0: Const(
  95. name: Identifier(
  96. name: E
  97. )
  98. value: Scalar_Int(
  99. value: 5
  100. )
  101. )
  102. )
  103. )
  104. )
  105. )
  106. )