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.
namespace externalServices\Service; class FirstService extends Exception { }
现在 Exception 没有定义。我知道我可以使用 \Exception AS Exception; 但是如何将所有本机类导入命名空间
做不到。
解决方案是手动导入...
use Exception; //Notice leading \ is not needed
或者使用绝对路径...
class FirstService extends \Exception {