菜谱项目

constModifiers.test 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. }
  10. -----
  11. !!php7
  12. array(
  13. 0: Stmt_Class(
  14. flags: 0
  15. name: Foo
  16. extends: null
  17. implements: array(
  18. )
  19. stmts: array(
  20. 0: Stmt_ClassConst(
  21. flags: 0
  22. consts: array(
  23. 0: Const(
  24. name: A
  25. value: Scalar_LNumber(
  26. value: 1
  27. )
  28. )
  29. )
  30. )
  31. 1: Stmt_ClassConst(
  32. flags: MODIFIER_PUBLIC (1)
  33. consts: array(
  34. 0: Const(
  35. name: B
  36. value: Scalar_LNumber(
  37. value: 2
  38. )
  39. )
  40. )
  41. )
  42. 2: Stmt_ClassConst(
  43. flags: MODIFIER_PROTECTED (2)
  44. consts: array(
  45. 0: Const(
  46. name: C
  47. value: Scalar_LNumber(
  48. value: 3
  49. )
  50. )
  51. )
  52. )
  53. 3: Stmt_ClassConst(
  54. flags: MODIFIER_PRIVATE (4)
  55. consts: array(
  56. 0: Const(
  57. name: D
  58. value: Scalar_LNumber(
  59. value: 4
  60. )
  61. )
  62. )
  63. )
  64. )
  65. )
  66. )