Fatal error: Namespace declaration statement has to be the very first statement or after any declare...

学习php的命名空间,直接把手册的代码粘贴过来,却报错了:Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in

代码如下:

 1 php 
 2 namespace my\name; // 参考 "定义命名空间" 小节
 3 
 4 
 5 class MyClass {}
 6 function myfunction() {}
 7 const MYCONST = 1

你可能感兴趣的:(php,开发工具)