mirror of
https://github.com/php/php-src.git
synced 2024-12-19 06:50:17 +08:00
50 lines
658 B
PHP
Executable File
50 lines
658 B
PHP
Executable File
--TEST--
|
|
010: Accesing internal namespace class
|
|
--FILE--
|
|
<?php
|
|
namespace X;
|
|
use X as Y;
|
|
class Foo {
|
|
const C = "const ok\n";
|
|
static $var = "var ok\n";
|
|
function __construct() {
|
|
echo "class ok\n";
|
|
}
|
|
static function bar() {
|
|
echo "method ok\n";
|
|
}
|
|
}
|
|
new Foo();
|
|
new X::Foo();
|
|
new Y::Foo();
|
|
new ::X::Foo();
|
|
Foo::bar();
|
|
X::Foo::bar();
|
|
Y::Foo::bar();
|
|
::X::Foo::bar();
|
|
echo Foo::C;
|
|
echo X::Foo::C;
|
|
echo Y::Foo::C;
|
|
echo ::X::Foo::C;
|
|
echo Foo::$var;
|
|
echo X::Foo::$var;
|
|
echo Y::Foo::$var;
|
|
echo ::X::Foo::$var;
|
|
--EXPECT--
|
|
class ok
|
|
class ok
|
|
class ok
|
|
class ok
|
|
method ok
|
|
method ok
|
|
method ok
|
|
method ok
|
|
const ok
|
|
const ok
|
|
const ok
|
|
const ok
|
|
var ok
|
|
var ok
|
|
var ok
|
|
var ok
|