Home  >  Article  >  Backend Development  >  这么写是咋回事

这么写是咋回事

WBOY
WBOYOriginal
2016-06-13 12:19:381061browse

这么写是怎么回事
看到别人这么写
$veiryt=new \Think\home();
是不是写错了
------解决思路----------------------
$veiryt=new \Think\home();

实例化命名空间 Think 中的 home 类
显然这段代码不是在 Think 命名空间内,所以要 \Think 来指示位置
------解决思路----------------------
命名空间,php5.3之后就可以这样写

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn