2007-07-12 17:23:48 +08:00
|
|
|
--TEST--
|
|
|
|
002: Import in namespace
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2008-12-05 04:12:30 +08:00
|
|
|
namespace test\ns1;
|
2007-07-12 17:23:48 +08:00
|
|
|
|
|
|
|
class Foo {
|
|
|
|
static function bar() {
|
|
|
|
echo __CLASS__,"\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-05 04:12:30 +08:00
|
|
|
use test\ns1\Foo as Bar;
|
|
|
|
use test\ns1 as ns2;
|
|
|
|
use test\ns1;
|
2007-07-12 17:23:48 +08:00
|
|
|
|
|
|
|
Foo::bar();
|
2008-12-05 04:12:30 +08:00
|
|
|
\test\ns1\Foo::bar();
|
2007-07-12 17:23:48 +08:00
|
|
|
Bar::bar();
|
2008-12-05 04:12:30 +08:00
|
|
|
ns2\Foo::bar();
|
|
|
|
ns1\Foo::bar();
|
2020-08-09 17:06:57 +08:00
|
|
|
?>
|
2007-07-12 17:23:48 +08:00
|
|
|
--EXPECT--
|
2008-12-05 04:12:30 +08:00
|
|
|
test\ns1\Foo
|
|
|
|
test\ns1\Foo
|
|
|
|
test\ns1\Foo
|
|
|
|
test\ns1\Foo
|
|
|
|
test\ns1\Foo
|