mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
35 lines
433 B
PHP
Executable File
35 lines
433 B
PHP
Executable File
--TEST--
|
|
001: Class in namespace
|
|
--FILE--
|
|
<?php
|
|
namespace test\ns1;
|
|
|
|
class Foo {
|
|
|
|
function __construct() {
|
|
echo __CLASS__,"\n";
|
|
}
|
|
|
|
function bar() {
|
|
echo __CLASS__,"\n";
|
|
}
|
|
|
|
static function baz() {
|
|
echo __CLASS__,"\n";
|
|
}
|
|
}
|
|
|
|
$x = new Foo;
|
|
$x->bar();
|
|
Foo::baz();
|
|
$y = new \test\ns1\Foo;
|
|
$y->bar();
|
|
\test\ns1\Foo::baz();
|
|
--EXPECT--
|
|
test\ns1\Foo
|
|
test\ns1\Foo
|
|
test\ns1\Foo
|
|
test\ns1\Foo
|
|
test\ns1\Foo
|
|
test\ns1\Foo
|