php命名空间示范

<?php
//一个文件里两个命名空间
namespace Article;
class comment{
function test(){
return 'aaa';
}
}

namespace MessageBoard;
class Comment{
function test(){
return 'www';
}
}

$comment = new comment();
$a = new MessageBoardComment();
echo $a->test();

$obj = new ArticleComment();
echo $obj->test();
?>

原文地址:https://www.cnblogs.com/ayanboke/p/6490126.html