require

(PHP 4, PHP 5, PHP 7, PHP 8)

requireinclude 相同,只是在失败时还会产生 Error 异常(PHP 8.0.0 之前为 E_COMPILE_ERROR 级别错误),而 include 只会产生警告(E_WARNING 级别错误)。

参见 include 文档了解详情。