如题所述
å 为使ç¨äºphpçå½å空é´ï¼æ¼ç¤ºä»£ç å¦ä¸ï¼
// å建å½å空é´Article
namespace Article;
class Comment { }
// å建å½å空é´MessageBoard
namespace MessageBoard;
class Comment { }
//è°ç¨å½å空é´ï¼MessageBoardï¼çCommentç±»
$comment = new Comment();
//è°ç¨Article空é´çCommentç±»
$article_comment = new \Article\Comment();
// å建å½å空é´Article
namespace Article;
class Comment { }
// å建å½å空é´MessageBoard
namespace MessageBoard;
class Comment { }
//è°ç¨å½å空é´ï¼MessageBoardï¼çCommentç±»
$comment = new Comment();
//è°ç¨Article空é´çCommentç±»
$article_comment = new \Article\Comment();
温馨提示:答案为网友推荐,仅供参考