outsideStmtInvalid.test 397 B

1234567891011121314151617181920
  1. There (mostly) can't be statements outside of namespaces
  2. -----
  3. <?php
  4. echo 1;
  5. namespace A;
  6. -----
  7. Namespace declaration statement has to be the very first statement in the script on line 3
  8. -----
  9. <?php
  10. namespace A {}
  11. echo 1;
  12. -----
  13. No code may exist outside of namespace {} on line 3
  14. -----
  15. <?php
  16. namespace A {}
  17. declare(ticks=1);
  18. namespace B {}
  19. -----
  20. No code may exist outside of namespace {} on line 3