The latest difference in require include php5 is that Baidu has many errors ., Requirephp5
The error reporting mechanism is different between the two. include indicates that the program continues to be executed by warning. require will report a fatal error and interrupt the program running.
The former has a return value, while the latter does not.
Note that there is no difference in php5. Previously, require is unconditionally included, that is, the file is included regardless of whether the condition is true or not. I also accidentally tested and found out today. There is no such difference.
If you don't believe it, try the following code: code in the. php file
<? Php $ a = '1'; if ($ a) {require ('B. php');} else {require ('C. php');}?>
B. php file code
<? Phpecho "B file";?>
C. php file code
<? Phpecho "c file";?>
Access a. php results
// File B
We can see that require and include are both conditional.