ns_002.phpt 358 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. 002: Import in namespace
  3. --FILE--
  4. <?php
  5. namespace test\ns1;
  6. class Foo {
  7. static function bar() {
  8. echo __CLASS__,"\n";
  9. }
  10. }
  11. use test\ns1\Foo as Bar;
  12. use test\ns1 as ns2;
  13. use test\ns1;
  14. Foo::bar();
  15. \test\ns1\Foo::bar();
  16. Bar::bar();
  17. ns2\Foo::bar();
  18. ns1\Foo::bar();
  19. ?>
  20. --EXPECT--
  21. test\ns1\Foo
  22. test\ns1\Foo
  23. test\ns1\Foo
  24. test\ns1\Foo
  25. test\ns1\Foo