ns_086.phpt 560 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. 086: bracketed namespace with encoding
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("mbstring")) {
  6. die("skip Requires mbstring extension");
  7. }
  8. ?>
  9. --INI--
  10. zend.multibyte=1
  11. --FILE--
  12. <?php
  13. declare(encoding='utf-8');
  14. namespace foo {
  15. use \foo;
  16. class bar {
  17. function __construct() {echo __METHOD__,"\n";}
  18. }
  19. new foo;
  20. new bar;
  21. }
  22. namespace {
  23. class foo {
  24. function __construct() {echo __METHOD__,"\n";}
  25. }
  26. use foo\bar as foo1;
  27. new foo1;
  28. new foo;
  29. echo "===DONE===\n";
  30. }
  31. --EXPECT--
  32. foo::__construct
  33. foo\bar::__construct
  34. foo\bar::__construct
  35. foo::__construct
  36. ===DONE===