summaryrefslogtreecommitdiff
path: root/Zend/tests/ns_037.phpt
blob: db0a76e940d2407b1919a9fb0b5804b25782b44b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
037: Name ambiguity (namespace name or namespace's class name)
--FILE--
<?php
namespace X;
use X as Y;
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();
new Y\X();
new \X\X();
X::bar();
Y\X::bar();
\X\X::bar();
echo X::C;
echo Y\X::C;
echo \X\X::C;
echo X::$var;
echo Y\X::$var;
echo \X\X::$var;
--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