Namespace declaration statement has to be the very first statement in the script

php 中 

 Namespace declaration statement has to be the very first statement in the script 错误解决方法:

 

在PHP文件中编写有namespace 时候提示此错误,应该将  <?php  开始前面不能有语句,空行也不行。

如果是在含有<html>语言的混合php 文件里面,且文件里面至少有一个<?php   ?>代码段时候,只要用到namespace,该文件的首行必须以<?php开头.

 

 
posted @ 2017-06-02 18:19  左正  阅读(981)  评论(0编辑  收藏  举报