You find the differences explained in the detailed PHP manual on the page of require
:
require
is identical toinclude
except upon failure it will also produce a fatalE_COMPILE_ERROR
level error. In other words, it will halt the script whereas include only emits a warning (E_WARNING
) which allows the script to continue.
See @efritz's answer for an example