开发者

PHP handle "Failed opening ... for inclusion" error

开发者 https://www.devze.com 2023-02-10 15:50 出处:网络
I have a PHP script that triggers some \"Failed opening ... for inclusion\" fatal errors 开发者_高级运维while using an external library.

I have a PHP script that triggers some "Failed opening ... for inclusion" fatal errors 开发者_高级运维while using an external library.

Those errors are completely irrelevant and I would like to be able to handle them (doing basically nothing about those) to avoid errors to be raised.

How can I achieve that in PHP?

Thanks,

DaN


If you absolutely want to hide the errors you can take a look at PHP's Error Control Operators. There's usually a reason for errors and/or warnings so it might be better to figure out what's causing these instead of just masking them.


You can suppress errors from individual statements by preceding it with the @ operator. For instance:

@require_once('somefile.php');

0

精彩评论

暂无评论...
验证码 换一张
取 消