Differences between include and require

Source: Internet
Author: User
The difference between include () and require () statements lies in how they handle errors. Use require ()

The difference between include () and require () statements lies in how they handle errors. When you use require () to call a file error, the entire program will be stopped. if you encounter the same error when you call include (), a warning will be generated and the inclusion file execution will be stopped, jump out of the call code and continue execution. The behavior of the former is more intense, so require () and require_once () are used to include library files more securely, while include () and include_once () are applicable to the addition of modulo analysis. Both require () and require_once () are statements rather than functions. This means that parentheses can be omitted when they are used.


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.