ns_078.phpt 444 B

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