Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当尝试从 PHPUnit 加载带有绝对namespace \Blah;声明的源文件时,加载失败:
namespace \Blah;
Fatal error: Undefined constant 'Blah' in C:\path\to\file.php on line 3 Call Stack: ...
我怎样才能解决这个问题 ?
在网上搜索,我找到了 Eric Hogue 在 Twitter 上提出的解决方案: 使用相对命名空间声明,即namespace \Blah;变为
namespace Blah;
https://twitter.com/JeremyKendall/status/294956904067780610