What problem does PHP's try catch solve?

WBOY
Release: 2016-10-22 00:00:20
Original
1306 people have browsed it

I know that PHP has exception handling. I checked it on Baidu and they all told you how to write the syntax. Just follow the instructions above and assume you know how to use it. But I haven’t found an article that tells you why you should use try catch and what problem it appears to solve. I've seen it said that it can reduce "if...else and other wild ways" in the code, but I didn't go into details.
If you know anything, continue to look for the answer, and will come back often to pay attention to the answer to this question.

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template