1.php
<?php
namespace Foo\bar\subnamespace;
const Foo = 1;
function foo() { echo "in 1.php";}
class foo{
static function staticmethod(){}
}
2.php
<?php
namespace foo\bar;
//include '1.php';
use Foo\bar\subnamespace;
subnamespace\foo();
运行2.php
Fatal error: Call to undefined function Foo\bar\subnamespace\foo() in F:\www\try\2.php on line 7
PHP Fatal error: Call to undefined function Foo\bar\subnamespace\foo() in F:\www\try\2.php on line 7
命名空间不能自动加载文件吗??