命名空间无效,PHPStorm去除BOM头
文件不是UTF-8 无BOM编码或者当用记事本打开无BOM文件的时候会自动的给UTF-8编码文件加上隐藏的BOM头,
所以使用命名空间的话就会报错 'Namespace declaration statement has to be the very first statement in the script;' 命名空间的定义必须是PHP文件的第一条语句。
网上有很多其他编辑器处理方法,我这里用的PHPstorm编辑器,直接在界面右击菜单 remove bom就好了
Namespace declaration statement has to be the very first statement in the script;定义命名空间无效
最新推荐文章于 2022-05-13 14:34:38 发布