2007-07-12 17:23:48 +08:00
|
|
|
--TEST--
|
|
|
|
001: Class 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 {
|
|
|
|
|
|
|
|
function __construct() {
|
|
|
|
echo __CLASS__,"\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
function bar() {
|
|
|
|
echo __CLASS__,"\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
static function baz() {
|
|
|
|
echo __CLASS__,"\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$x = new Foo;
|
|
|
|
$x->bar();
|
|
|
|
Foo::baz();
|
2008-12-05 04:12:30 +08:00
|
|
|
$y = new \test\ns1\Foo;
|
2007-07-12 17:23:48 +08:00
|
|
|
$y->bar();
|
2008-12-05 04:12:30 +08:00
|
|
|
\test\ns1\Foo::baz();
|
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
|
|
|
|
test\ns1\Foo
|