mix.test 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. Namespace types cannot be mixed
  2. -----
  3. <?php
  4. namespace A;
  5. echo 1;
  6. namespace B {
  7. echo 2;
  8. }
  9. echo 3;
  10. -----
  11. Cannot mix bracketed namespace declarations with unbracketed namespace declarations from 4:1 to 4:9
  12. array(
  13. 0: Stmt_Namespace(
  14. name: Name(
  15. name: A
  16. )
  17. stmts: array(
  18. 0: Stmt_Echo(
  19. exprs: array(
  20. 0: Scalar_Int(
  21. value: 1
  22. )
  23. )
  24. )
  25. )
  26. )
  27. 1: Stmt_Namespace(
  28. name: Name(
  29. name: B
  30. )
  31. stmts: array(
  32. 0: Stmt_Echo(
  33. exprs: array(
  34. 0: Scalar_Int(
  35. value: 2
  36. )
  37. )
  38. )
  39. )
  40. )
  41. 2: Stmt_Echo(
  42. exprs: array(
  43. 0: Scalar_Int(
  44. value: 3
  45. )
  46. )
  47. )
  48. )
  49. -----
  50. <?php
  51. namespace A {
  52. echo 1;
  53. }
  54. echo 2;
  55. namespace B;
  56. echo 3;
  57. -----
  58. Cannot mix bracketed namespace declarations with unbracketed namespace declarations from 6:1 to 6:9
  59. array(
  60. 0: Stmt_Namespace(
  61. name: Name(
  62. name: A
  63. )
  64. stmts: array(
  65. 0: Stmt_Echo(
  66. exprs: array(
  67. 0: Scalar_Int(
  68. value: 1
  69. )
  70. )
  71. )
  72. )
  73. )
  74. 1: Stmt_Echo(
  75. exprs: array(
  76. 0: Scalar_Int(
  77. value: 2
  78. )
  79. )
  80. )
  81. 2: Stmt_Namespace(
  82. name: Name(
  83. name: B
  84. )
  85. stmts: array(
  86. 0: Stmt_Echo(
  87. exprs: array(
  88. 0: Scalar_Int(
  89. value: 3
  90. )
  91. )
  92. )
  93. )
  94. )
  95. )