xref: /PHP-7.0/Zend/tests/ns_037.phpt (revision 610c7fbe)
1--TEST--
2037: Name ambiguity (namespace name or namespace's class name)
3--FILE--
4<?php
5namespace X;
6use X as Y;
7class X {
8	const C = "const ok\n";
9	static $var = "var ok\n";
10	function __construct() {
11		echo "class ok\n";
12	}
13	static function bar() {
14		echo "method ok\n";
15	}
16}
17new X();
18new Y\X();
19new \X\X();
20X::bar();
21Y\X::bar();
22\X\X::bar();
23echo X::C;
24echo Y\X::C;
25echo \X\X::C;
26echo X::$var;
27echo Y\X::$var;
28echo \X\X::$var;
29--EXPECT--
30class ok
31class ok
32class ok
33method ok
34method ok
35method ok
36const ok
37const ok
38const ok
39var ok
40var ok
41var ok
42