2007-09-29 03:52:53 +08:00
|
|
|
--TEST--
|
|
|
|
037: Name ambiguity (namespace name or namespace's class name)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
namespace X;
|
2007-11-07 17:13:50 +08:00
|
|
|
use X as Y;
|
2007-09-29 03:52:53 +08:00
|
|
|
class X {
|
|
|
|
const C = "const ok\n";
|
|
|
|
static $var = "var ok\n";
|
|
|
|
function __construct() {
|
|
|
|
echo "class ok\n";
|
|
|
|
}
|
|
|
|
static function bar() {
|
|
|
|
echo "method ok\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
new X();
|
2008-11-04 23:58:55 +08:00
|
|
|
new Y\X();
|
|
|
|
new \X\X();
|
2007-09-29 03:52:53 +08:00
|
|
|
X::bar();
|
2008-11-04 23:58:55 +08:00
|
|
|
Y\X::bar();
|
|
|
|
\X\X::bar();
|
2007-09-29 03:52:53 +08:00
|
|
|
echo X::C;
|
2008-11-04 23:58:55 +08:00
|
|
|
echo Y\X::C;
|
|
|
|
echo \X\X::C;
|
2007-09-29 03:52:53 +08:00
|
|
|
echo X::$var;
|
2008-11-04 23:58:55 +08:00
|
|
|
echo Y\X::$var;
|
|
|
|
echo \X\X::$var;
|
2007-09-29 03:52:53 +08:00
|
|
|
--EXPECT--
|
|
|
|
class ok
|
|
|
|
class ok
|
|
|
|
class ok
|
|
|
|
method ok
|
|
|
|
method ok
|
|
|
|
method ok
|
|
|
|
const ok
|
|
|
|
const ok
|
|
|
|
const ok
|
|
|
|
var ok
|
|
|
|
var ok
|
|
|
|
var ok
|