Home  >  Article  >  Backend Development  >  PHP中命名空间的创建-使用namespace

PHP中命名空间的创建-使用namespace

WBOY
WBOYOriginal
2016-06-23 13:29:31840browse

PHP中命名空间的创建要使用关键字namespace

如下面在sub1.php文件下创建命名空间为root\sub1


需要注意的是,当前脚本文件的第一个命名空间前面不能有任何代码,如下面的写法是错误的。




版权声明:本文为博主原创文章,未经博主允许不得转载。

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