constModifiers.test 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. !!php7
  13. array(
  14. 0: Stmt_Class(
  15. attrGroups: array(
  16. )
  17. flags: 0
  18. name: Identifier(
  19. name: Foo
  20. )
  21. extends: null
  22. implements: array(
  23. )
  24. stmts: array(
  25. 0: Stmt_ClassConst(
  26. attrGroups: array(
  27. )
  28. flags: 0
  29. type: null
  30. consts: array(
  31. 0: Const(
  32. name: Identifier(
  33. name: A
  34. )
  35. value: Scalar_LNumber(
  36. value: 1
  37. )
  38. )
  39. )
  40. )
  41. 1: Stmt_ClassConst(
  42. attrGroups: array(
  43. )
  44. flags: MODIFIER_PUBLIC (1)
  45. type: null
  46. consts: array(
  47. 0: Const(
  48. name: Identifier(
  49. name: B
  50. )
  51. value: Scalar_LNumber(
  52. value: 2
  53. )
  54. )
  55. )
  56. )
  57. 2: Stmt_ClassConst(
  58. attrGroups: array(
  59. )
  60. flags: MODIFIER_PROTECTED (2)
  61. type: null
  62. consts: array(
  63. 0: Const(
  64. name: Identifier(
  65. name: C
  66. )
  67. value: Scalar_LNumber(
  68. value: 3
  69. )
  70. )
  71. )
  72. )
  73. 3: Stmt_ClassConst(
  74. attrGroups: array(
  75. )
  76. flags: MODIFIER_PRIVATE (4)
  77. type: null
  78. consts: array(
  79. 0: Const(
  80. name: Identifier(
  81. name: D
  82. )
  83. value: Scalar_LNumber(
  84. value: 4
  85. )
  86. )
  87. )
  88. )
  89. 4: Stmt_ClassConst(
  90. attrGroups: array(
  91. )
  92. flags: MODIFIER_FINAL (32)
  93. type: null
  94. consts: array(
  95. 0: Const(
  96. name: Identifier(
  97. name: E
  98. )
  99. value: Scalar_LNumber(
  100. value: 5
  101. )
  102. )
  103. )
  104. )
  105. )
  106. )
  107. )