Die Function
18.4 handle errors
In many cases, system calls may fail. For example, you can try to open a non-existing file, delete a directory that still contains the file, or
Try to read files without read permission. In the previous example, we
Translated original address: http://www.alfajango.com/blog/exploring-jquery-live-and-die/Many developers know about JQuery's. Live () method, most of them know what the function does, but do not know how it is implemented, so it is not so
PHP supports an error control operator: @. Any error messages that may be generated by the expression are ignored until it is placed in a PHP expression.
If a custom error handler is set with Set_error_handler (), it will still be called, but this
What is. Live ()The live method is similar to. bind (), which, in addition, allows you to bind events to DOM elements, and you can bind events to elements that do not yet exist in the DOM, and look at the following example:
For example, when the
It has been hard to understand exception handling. for example, my program uses a mysql database connection at the underlying layer, and all my upper-layer programs are built on this basis (without considering caching or other issues ), for example,
Heavily used in PHP
dieOr
exit, are there any other drawbacks in terms of readability?
Reply content:
Is there a lot of use in PHP die or is exit there any other drawbacks in terms of readability?
I think die() / exit() mainly affect the
Die: Stop when you encounter an errorDie (): Stop program run, output contentExit: Is the stop program running, is directly stopped, and does not run subsequent code, does not output contentExit (): content can be displayed.Exit (0): Run the program
Php uses die or exit in a lot. Is there any other disadvantage in readability? Php is widely used.
dieOr
exitAre there other drawbacks besides readability?
Reply content:
Php is widely used.dieOrexitAre there other drawbacks besides readability?
Transferred from: http://www.bawo.me/point-of-view/jzydppbswebys-375.htmlIntroduction: Here, said the app will die, Web life, is the current need to download and install mobile Internet application Mode, inevitably decline (but not decay), and the
Parse the differences between die (), exit (), and return in php. Die () stops running the program. The Output Content exit indicates that the program is stopped. If no output content return indicates that the return value is die. If an error occurs,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.