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

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

WBOY
Release: 2016-06-23 13:29:31
Original
915 people have browsed it

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

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


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




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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template