xref: /PHP-8.0/Zend/tests/ns_010.phpt (revision 7aacc705)
1--TEST--
2010: Accessing internal namespace class
3--FILE--
4<?php
5namespace X;
6use X as Y;
7class Foo {
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 Foo();
18new Y\Foo();
19new \X\Foo();
20Foo::bar();
21Y\Foo::bar();
22\X\Foo::bar();
23echo Foo::C;
24echo Y\Foo::C;
25echo \X\Foo::C;
26echo Foo::$var;
27echo Y\Foo::$var;
28echo \X\Foo::$var;
29?>
30--EXPECT--
31class ok
32class ok
33class ok
34method ok
35method ok
36method ok
37const ok
38const ok
39const ok
40var ok
41var ok
42var ok
43