You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
505 B

<?php
namespace Foo\Bar\subnamespace;
const FOO = 1;
function foo() {
echo '命名空间:'.__NAMESPACE__.'--函数:foo'.'<br>';
}
class foo
{
// public function demo() {
//如果使用public,会报错Fatal error: Uncaught Error: Non-static method Foo\Bar\subnamespace\foo::demo() cannot be called statically in
static function demo() {
echo '命名空间为:'.__NAMESPACE__.'--类foo的方法demo'.'<br>';
}
}
?>