Answer the question
In order to leave comments, you need to log in
Is it possible to disable the exception?
I'm trying to write a parser for this, I use the Snoopy.class class on some pages (not on all) it gives out such an exception.
PHP Warning – yii\base\ErrorException
fsockopen():
<b>Warning</b>: fsockopen(): in <b>C:\OpenServer\domains\kinopoisk\Snoopy.class.php</b> on line <b>1142</b><br />
Answer the question
In order to leave comments, you need to log in
Why disable exceptions? They just say something is wrong. Learn to use them correctly and programming will become easier
try {
//Тут что то делаем с сокетом
fsockopen();
} catch (ErrorException $e) {
//Что то пошло не так - обработаем исключение, например, так:
echo $e->getMessage();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question