[PHP]Difference between require and include

require:
1.Upon failure it will also produce a fatalE_COMPILE_ERROR.
2. require() will always read in the target file, even if the line it's on never executes. That means if require() is in 'if', no matter whether the condition is met, the file will be read.

include:
1.Upon failure it will only emit a warning E_WARNING.
2.Can conditionally include a file.

评论