Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

phpstorm 错误检测导致的红色波浪线

try {
    // PHP Fatal error:  Uncaught Error: Call to private Singleton::__construct() from invalid context
    $obj = new Singleton();
} catch (Error $e) {
}

类似上面的代码 Singleton为单例类,不能直接new。 其实已经对错误进行捕获了,但是phpstorm里面还是会标错。想取消这个错误若何处理

image.png

phpstorm版本 2019.3


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

image.png
我的版本也是2019.3的,你点击右下角的小人头,就在分支旁边的那个,然后把PHP划到None就可以了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...